Commit bd7795ad authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #1454 from asottile/python4

Fix references to six.PY3 in case python4 becomes a thing
parents dc2a6f94 b914fd44
...@@ -120,7 +120,7 @@ except ImportError: ...@@ -120,7 +120,7 @@ except ImportError:
__version__ = '1.3.0' __version__ = '1.3.0'
__all__ = ('Traceback',) __all__ = ('Traceback',)
PY3 = sys.version_info[0] == 3 PY3 = sys.version_info[0] >= 3
FRAME_RE = re.compile(r'^\s*File "(?P<co_filename>.+)", line (?P<tb_lineno>\d+)(, in (?P<co_name>.+))?$') FRAME_RE = re.compile(r'^\s*File "(?P<co_filename>.+)", line (?P<tb_lineno>\d+)(, in (?P<co_name>.+))?$')
......
import sys import sys
# pylint:disable=unused-argument,import-error # pylint:disable=unused-argument,import-error
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] >= 3 PY3 = sys.version_info[0] >= 3
if PY3: if PY3:
......
...@@ -62,7 +62,7 @@ PY36 = None ...@@ -62,7 +62,7 @@ PY36 = None
PY37 = None PY37 = None
NON_APPLICABLE_SUFFIXES = () NON_APPLICABLE_SUFFIXES = ()
if sys.version_info[0] == 3: if sys.version_info[0] >= 3:
# Python 3 # Python 3
NON_APPLICABLE_SUFFIXES += ('2', '279') NON_APPLICABLE_SUFFIXES += ('2', '279')
PY2 = False PY2 = False
......
...@@ -27,7 +27,7 @@ NOT_IMPLEMENTED = { ...@@ -27,7 +27,7 @@ NOT_IMPLEMENTED = {
'select': ANY, 'select': ANY,
'os': ANY, 'os': ANY,
'threading': ANY, 'threading': ANY,
'builtins' if six.PY3 else '__builtin__': ANY, '__builtin__' if six.PY2 else 'builtins': ANY,
'signal': ANY, 'signal': ANY,
} }
......
...@@ -4,7 +4,7 @@ import gevent.testing as greentest ...@@ -4,7 +4,7 @@ import gevent.testing as greentest
from gevent.testing import six from gevent.testing import six
from gevent.testing import ExpectedException as ExpectedError from gevent.testing import ExpectedException as ExpectedError
if not six.PY3: if six.PY2:
sys.exc_clear() sys.exc_clear()
class RawException(Exception): class RawException(Exception):
......
...@@ -124,7 +124,7 @@ class TestTCP(greentest.TestCase): ...@@ -124,7 +124,7 @@ class TestTCP(greentest.TestCase):
def test_sendall_str(self): def test_sendall_str(self):
self._test_sendall(self.long_data) self._test_sendall(self.long_data)
if not six.PY3: if six.PY2:
def test_sendall_unicode(self): def test_sendall_unicode(self):
self._test_sendall(six.text_type(self.long_data)) self._test_sendall(six.text_type(self.long_data))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment