Re: no more print statements in SConscripts?

Tim Jenness <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <[email protected]>
> On May 25, 2016, at 11:16 , Bill Deegan <[email protected]> wrote:
> 
> I think this is a python global flag isn't it?
> I don't think you can turn it on and off selectively?
> 

It’s per file. If you add

from __future__ import print_function

at the top of your file that file will have print(). Without it the print will be a statement. What you can’t do is change print from a statement to a function or vice versa in the middle of a file (so that __future__ import must be at the top of the file).

I don’t really know how SConstruct files are imported so it may be that there is something about the importing that inherits the print_function state of the code doing the reading of the file (are they read and then evaled?). If they are read and then the string evaluated that might explain the problem. If they are imported with importlib then I’m confused.

— 
Tim Jenness
_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.