Tweak comment style
This commit is contained in:
parent
0371b14567
commit
cc1e1648f5
1 changed files with 16 additions and 6 deletions
|
@ -69,31 +69,41 @@ import errno
|
||||||
from itertools import repeat
|
from itertools import repeat
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from itertools import imap # Python 2
|
# Python 2
|
||||||
|
from itertools import imap
|
||||||
except ImportError:
|
except ImportError:
|
||||||
imap = map # Python 3
|
# Python 3
|
||||||
|
imap = map
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Python 2
|
||||||
basestring
|
basestring
|
||||||
except NameError:
|
except NameError:
|
||||||
basestring = str # Python 3
|
# Python 3
|
||||||
|
basestring = str
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Python 2
|
||||||
unicode
|
unicode
|
||||||
except NameError:
|
except NameError:
|
||||||
unicode = str # Python 3
|
# Python 3
|
||||||
|
unicode = str
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Python 2.6+
|
||||||
bytes
|
bytes
|
||||||
except NameError:
|
except NameError:
|
||||||
bytes = str # Python 2
|
# Python 2.4
|
||||||
|
bytes = str
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dict.iteritems
|
dict.iteritems
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def iteritems(d): # Python 3
|
# Python 3
|
||||||
|
def iteritems(d):
|
||||||
return d.items()
|
return d.items()
|
||||||
else:
|
else:
|
||||||
|
# Python 2
|
||||||
def iteritems(d): # Python 2
|
def iteritems(d): # Python 2
|
||||||
return d.iteritems()
|
return d.iteritems()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue