Skip to content

Commit e94a701

Browse files
committed
Python 3 compatibility. New strategy for unicode support from Python 2.6 to 3.3:
removed all references to `py3compat.u` function (which replaced the u'' and u"" unicode strings) by `from __future__ import unicode_literals`. Python 2.6 to 3.3 support for unicode strings now simply relies on the removal of all `u` string prefixes and the addition of the unicode future statement at the beginnning of scripts: `from __future__ import unicode_literals`.
1 parent 022a5b5 commit e94a701

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

winpython/py3compat.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,6 @@
7777
#==============================================================================
7878
# Strings
7979
#==============================================================================
80-
if PY2:
81-
# Python 2
82-
import codecs
83-
def u(obj):
84-
"""Make unicode object"""
85-
return codecs.unicode_escape_decode(obj)[0]
86-
else:
87-
# Python 3
88-
def u(obj):
89-
"""Return string as it is"""
90-
return obj
91-
9280
def is_text_string(obj):
9381
"""Return True if `obj` is a text string, False if it is anything else,
9482
like binary data (Python 3) or QString (Python 2, PyQt API #1)"""

0 commit comments

Comments
 (0)