diff options
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Defaults.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/TaskmasterTests.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Tool/intelc.py | 4 |
5 files changed, 13 insertions, 11 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index ece6d59..be6ea9f 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -31,13 +31,12 @@ from distutils.msvccompiler. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import division __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - import os -import os.path import errno import shutil import stat @@ -435,7 +434,7 @@ class Variable_Method_Caller: self.variable = variable self.method = method def __call__(self, *args, **kw): - try: 1/0 + try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 7fcec8f..38a895b 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -20,6 +20,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import division __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -1307,7 +1308,7 @@ class FSTestCase(_tempdirTestCase): # We round down the current time to the nearest even integer # value, subtract two to make sure the timestamp is not "now," # and then convert it back to a float. - tstamp = float(int(time.time() / 2) * 2) - 2 + tstamp = float(int(time.time() // 2) * 2) - 2.0 os.utime(test.workpath("tstamp"), (tstamp - 2.0, tstamp)) f = fs.File("tstamp") t = f.get_timestamp() @@ -1325,7 +1326,7 @@ class FSTestCase(_tempdirTestCase): f2 = test.workpath('tdir2', 'file2') test.write(f1, 'file1\n') test.write(f2, 'file2\n') - current_time = float(int(time.time() / 2) * 2) + current_time = float(int(time.time() // 2) * 2) t1 = current_time - 4.0 t2 = current_time - 2.0 os.utime(f1, (t1 - 2.0, t1)) @@ -2786,7 +2787,7 @@ class RepositoryTestCase(_tempdirTestCase): # We round down the current time to the nearest even integer # value, subtract two to make sure the timestamp is not "now," # and then convert it back to a float. - tstamp = float(int(time.time() / 2) * 2) - 2 + tstamp = float(int(time.time() // 2) * 2) - 2.0 os.utime(test.workpath("rep2", "tstamp"), (tstamp - 2.0, tstamp)) f = fs.File("tstamp") t = f.get_timestamp() diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 5928a88..ed077ba 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -26,6 +26,7 @@ files. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import division __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -77,7 +78,7 @@ sconscript_chdir = 1 def get_calling_namespaces(): """Return the locals and globals for the function that called into this module in the current call stack.""" - try: 1/0 + try: 1//0 except ZeroDivisionError: # Don't start iterating with the current stack-frame to # prevent creating reference cycles (f_back is safe). diff --git a/src/engine/SCons/TaskmasterTests.py b/src/engine/SCons/TaskmasterTests.py index 3dd22e3..e95e92c 100644 --- a/src/engine/SCons/TaskmasterTests.py +++ b/src/engine/SCons/TaskmasterTests.py @@ -20,6 +20,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +from __future__ import division __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -969,7 +970,7 @@ class TaskmasterTestCase(unittest.TestCase): t.exception_set(3) assert t.exception == 3 - try: 1/0 + try: 1//0 except: pass t.exception_set(None) exc_type, exc_value, exc_tb = t.exception @@ -1010,7 +1011,7 @@ class TaskmasterTestCase(unittest.TestCase): pass try: - 1/0 + 1//0 except: tb = sys.exc_info()[2] t.exception_set((Exception3, "arg", tb)) diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index 9f782ee..5629636 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -30,7 +30,7 @@ selection method. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# +from __future__ import division __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -81,7 +81,7 @@ def linux_ver_normalize(vstr): m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', vstr) if m: vmaj,vmin,build = m.groups() - return float(vmaj) * 10 + float(vmin) + float(build) / 1000.; + return float(vmaj) * 10. + float(vmin) + float(build) / 1000.; else: f = float(vstr) if is_windows: |