Use tuples not floats in Python release comparison

This commit is contained in:
rocky
2021-10-18 11:59:02 -04:00
parent 15efaffe8d
commit 8ac7a75372
26 changed files with 73 additions and 73 deletions

View File

@@ -149,7 +149,7 @@ def print_docstring(self, indent, docstring):
# Must be unicode in Python2
self.write('u')
docstring = repr(docstring.expandtabs())[2:-1]
elif PYTHON3 and 2.4 <= self.version <= 2.7:
elif PYTHON3 and (2, 4) <= self.version[:2] <= (2, 7):
try:
repr(docstring.expandtabs())[1:-1].encode("ascii")
except UnicodeEncodeError:

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2015-2020 by Rocky Bernstein
# Copyright (c) 2015-2021 by Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
#
# This program is free software: you can redistribute it and/or modify
@@ -192,7 +192,7 @@ def make_function2(self, node, is_lambda, nested=1, code_node=None):
)
# Python 2 doesn't support the "nonlocal" statement
assert self.version >= 3.0 or not nonlocals
assert self.version >= (3, 0) or not nonlocals
for g in sorted((all_globals & self.mod_globs) | globals):
self.println(self.indent, "global ", g)