You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Use tuples not floats in Python release comparison
This commit is contained in:
@@ -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:
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user