Build error with Python 2.6.
Traceback (most recent call last):
File "./main/format_unpack.py", line 893, in <module>
template = Template(string, future_imports=['division']);
TypeError: __init__() got an unexpected keyword argument 'future_imports'
Author: Mathieu Bridon <firstname.lastname@example.org>
Date: Wed Jul 25 11:53:54 2018 +0200
python: Use explicit integer divisions
In Python 2, divisions of integers return an integer:
>>> 32 / 4
In Python 3 though, they return floats:
>>> 32 / 4
However, Python 3 has an explicit integer division operator:
>>> 32 // 4
That operator exists on Python >= 2.2, so let's use it everywhere to
make the scripts compatible with both Python 2 and 3.
In addition, using __future__.division tells Python 2 to behave the same
way as Python 3, which helps ensure the scripts produce the same output
in both versions of Python.
Signed-off-by: Mathieu Bridon <email@example.com>
Reviewed-by: Eric Engestrom <firstname.lastname@example.org> (v2)
Reviewed-by: Dylan Baker <email@example.com>
Scons doesn't check that mako is at least 0.8.0 like autotools does (which was released in 2013, btw). The real bug here is that scons doesn't do proper checks like it should.
Should be fixed with the following commit. Feel free to reopen otherwise.
Author: Dylan Baker <firstname.lastname@example.org>
Date: Tue Aug 14 10:32:12 2018 -0700
scons: Check for mako 0.8.0