Skip to content

Commit 0a7cc19

Browse files
committed
py3compat: fixed coding style
1 parent 95d6a72 commit 0a7cc19

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

winpython/py3compat.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
# Licensed under the terms of the MIT License
55
# (see spyderlib/__init__.py for details)
66

7-
#==============================================================================
8-
# This is the exact copy of spyderlib.py3compat from Spyder Project
9-
#==============================================================================
10-
117
"""
12-
winpython.py3compat
13-
-------------------
8+
winpython.py3compat (exact copy of spyderlib.py3compat)
9+
-------------------------------------------------------
1410
1511
Transitional module providing compatibility functions intended to help
1612
migrating from Python 2 to Python 3.
@@ -28,6 +24,21 @@
2824
PY2 = sys.version[0] == '2'
2925
PY3 = sys.version[0] == '3'
3026

27+
28+
#==============================================================================
29+
# Data types
30+
#==============================================================================
31+
if PY2:
32+
# Python 2
33+
TEXT_TYPES = (str, unicode)
34+
INT_TYPES = (int, long)
35+
else:
36+
# Python 3
37+
TEXT_TYPES = (str,)
38+
INT_TYPES = (int,)
39+
NUMERIC_TYPES = tuple(list(INT_TYPES) + [float, complex])
40+
41+
3142
#==============================================================================
3243
# Renamed/Reorganized modules
3344
#==============================================================================
@@ -56,19 +67,10 @@
5667
import pickle
5768
from collections import MutableMapping
5869

70+
5971
#==============================================================================
6072
# Strings
6173
#==============================================================================
62-
if PY2:
63-
# Python 2
64-
text_types = (str, unicode)
65-
int_types = (int, long)
66-
else:
67-
# Python 3
68-
text_types = (str,)
69-
int_types = (int,)
70-
numeric_types = tuple(list(int_types) + [float, complex])
71-
7274
if PY2:
7375
# Python 2
7476
import codecs

0 commit comments

Comments
 (0)