[Scons-dev] SCons and octal constants

Russel Winder russel at winder.org.uk
Mon Apr 28 03:52:44 EDT 2014


On Mon, 2014-04-28 at 10:19 +0300, anatoly techtonik wrote:
[…]

>

> Let me sum this up. To make SCons codebase more 2/3 compatible, we

> need to use 0o777 instead of 0777.


Spot on. The 0o777 form works in Python 2.6 and 2.7 as well as being
necessary in Python 3.x (0777 is a syntax error in Python 3).


> Do you need help preparing PR?


Actually I think it may be fairly straightforward using find, grep and
emacs. Although there are quite a lot of octal constants I think it can
be done fairly quickly as a single changeset.

I think the best strategy is to do this on the Python 2 default/default
first and get that into place before seeing if the changeset can be
applied on default/python3-port rather than having to do all the edits
again.


> BTW, does anybody know a tool to grep Python AST for that?

> Maybe pylint with a single rule can do all the job automatically?

> Would be nice to see the command here for reference.


'fraid not, I tend to do this sort of thing with find and grep. I must
learn more about pylint though…

--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder



More information about the Scons-dev mailing list