Skip to content

Commit 8c75ec0

Browse files
committed
Removed rundundant and obsolete references to older python unicode compatibility
1 parent e995411 commit 8c75ec0

18 files changed

Lines changed: 23 additions & 105 deletions

File tree

Pythonwin/pywin/debugger/debugger.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@
2626
from pywin.mfc import afxres, dialog, object, window
2727
from pywin.tools import browser, hierlist
2828

29-
# import win32traceutil
30-
if win32ui.UNICODE:
31-
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITW
32-
else:
33-
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITA
34-
3529
from .dbgcon import *
3630

31+
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITW
3732
error = "pywin.debugger.error"
3833

3934

Pythonwin/pywin/framework/interact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def ColorizeInteractiveCode(self, cdoc, styleStart, stylePyStart):
138138
return
139139
state = styleStart
140140
# As per comments in Colorize(), we work with the raw utf8
141-
# bytes. To avoid too muych py3k pain, we treat each utf8 byte
141+
# bytes. To avoid too much pain, we treat each utf8 byte
142142
# as a latin-1 unicode character - we only use it to compare
143143
# against ascii chars anyway...
144144
chNext = cdoc[0:1].decode("latin-1")

Pythonwin/pywin/framework/toolmenu.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,7 @@ def HandleToolCommand(cmd, code):
149149
import commctrl
150150
from pywin.mfc import dialog
151151

152-
if win32ui.UNICODE:
153-
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITW
154-
else:
155-
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITA
152+
LVN_ENDLABELEDIT = commctrl.LVN_ENDLABELEDITW
156153

157154

158155
class ToolMenuPropPage(dialog.PropertyPage):

Pythonwin/pywin/idle/PyParse.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ def dump(*stuff):
122122
_tran[ord(ch)] = ")"
123123
for ch in "\"'\\\n#":
124124
_tran[ord(ch)] = ch
125-
# We are called with unicode strings, and str.translate is one of the few
126-
# py2k functions which can't 'do the right thing' - so take care to ensure
127-
# _tran is full of unicode...
128-
_tran = "".join(_tran)
129125
del ch
130126

131127

Pythonwin/pywin/tools/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def GetSubList(self):
309309
return ret
310310

311311

312-
# In Python 1.6, strings and Unicode have builtin methods, but we dont really want to see these
312+
# strings and Unicode have builtin methods, but we dont really want to see these
313313
class HLIString(HLIPythonObject):
314314
def IsExpandable(self):
315315
return 0

Pythonwin/pywin/tools/hierlist.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,8 @@ def HierInit(self, parent, listControl=None): # Used when window first exists.
106106
self.listControl.SetImageList(self.imageList, commctrl.LVSIL_NORMAL)
107107
# self.list.AttachObject(self)
108108

109-
## ??? Need a better way to do this - either some way to detect if it's compiled with UNICODE
110-
## defined, and/or a way to switch the constants based on UNICODE ???
111-
if sys.version_info[0] < 3:
112-
parent.HookNotify(self.OnTreeItemExpanding, commctrl.TVN_ITEMEXPANDINGA)
113-
parent.HookNotify(self.OnTreeItemSelChanged, commctrl.TVN_SELCHANGEDA)
114-
else:
115-
parent.HookNotify(self.OnTreeItemExpanding, commctrl.TVN_ITEMEXPANDINGW)
116-
parent.HookNotify(self.OnTreeItemSelChanged, commctrl.TVN_SELCHANGEDW)
109+
parent.HookNotify(self.OnTreeItemExpanding, commctrl.TVN_ITEMEXPANDINGW)
110+
parent.HookNotify(self.OnTreeItemSelChanged, commctrl.TVN_SELCHANGEDW)
117111
parent.HookNotify(self.OnTreeItemDoubleClick, commctrl.NM_DBLCLK)
118112
self.notify_parent = parent
119113

com/win32com/client/makepy.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@
3434
3535
-h -- Do not generate hidden methods.
3636
37-
-u -- Python 1.5 and earlier: Do NOT convert all Unicode objects to
38-
strings.
39-
40-
Python 1.6 and later: Convert all Unicode objects to strings.
37+
-u -- Convert all Unicode objects to strings.
4138
4239
-o -- Create output in a specified output file. If the path leading
4340
to the file does not exist, any missing directories will be

com/win32com/server/policy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,7 @@ class EventHandlerPolicy(DesignatedWrapPolicy):
680680
"""The default policy used by event handlers in the win32com.client package.
681681
682682
In addition to the base policy, this provides argument conversion semantics for
683-
params
684-
* dispatch params are converted to dispatch objects.
685-
* Unicode objects are converted to strings (1.5.2 and earlier)
683+
params: dispatch params are converted to dispatch objects
686684
687685
NOTE: Later, we may allow the object to override this process??
688686
"""

com/win32com/test/testCollections.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
#
66
# Also has the side effect of testing some of the PythonCOM error semantics.
77
import sys
8+
import unittest
89

910
import pythoncom
10-
import pywintypes
1111
import win32com.client
1212
import win32com.server.util
1313
import win32com.test.util
1414
import winerror
1515

16-
L = pywintypes.Unicode
17-
18-
import unittest
19-
2016
error = "collection test error"
2117

2218

com/win32com/test/testPersist.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import win32com.client.dynamic
99
import win32com.server.util
1010
import win32ui
11-
from pywintypes import Unicode
1211
from win32com import storagecon
1312
from win32com.axcontrol import axcontrol
1413
from win32com.test.util import CheckClean

0 commit comments

Comments
 (0)