We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfa318c commit ce51690Copy full SHA for ce51690
IPy.py
@@ -10,7 +10,6 @@
10
11
import bisect
12
import collections
13
-import sys
14
import types
15
16
# Definition of the Ranges for IPv4 IPs
@@ -121,13 +120,14 @@
121
120
IPV6_TEST_MAP = 0xffffffffffffffffffffffff00000000
122
IPV6_MAP_MASK = 0x00000000000000000000ffff00000000
123
124
-if sys.version_info >= (3,):
+try:
+ INT_TYPES = (int, long)
125
+ STR_TYPES = (str, unicode)
126
+ xrange
127
+except NameError:
128
INT_TYPES = (int,)
129
STR_TYPES = (str,)
130
xrange = range
-else:
- INT_TYPES = (int, long)
- STR_TYPES = (str, unicode)
131
132
133
class IPint(object):
0 commit comments