Skip to content

Commit 783af28

Browse files
committed
Making PY35 to only be applicable to 3.5.4 and newer
1 parent 32eaaed commit 783af28

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/compat/__init__.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
PY2 = sys.version_info[0] == 2
4343
PY3 = (sys.version_info[0] >= 3)
44-
PY35 = (sys.version_info >= (3, 5))
44+
PY35 = (sys.version_info >= (3, 5, 4))
4545
PY36 = (sys.version_info >= (3, 6))
4646
PYPY = (platform.python_implementation() == 'PyPy')
4747

@@ -424,7 +424,12 @@ def raise_with_traceback(exc, traceback=Ellipsis):
424424

425425

426426
# In Python 3.7, the private re._pattern_type is removed.
427-
re_type = type(re.compile(''))
427+
# Python 3.5+ have typing.re.Pattern
428+
if PY35:
429+
import typing
430+
re_type = typing.re.Pattern
431+
else:
432+
re_type = type(re.compile(''))
428433

429434
# https://github.com/pandas-dev/pandas/pull/9123
430435
def is_platform_little_endian():

0 commit comments

Comments
 (0)