Skip to content

Commit 6026a57

Browse files
authored
Remove lib2to3 comments and workarounds (#2397)
1 parent 0c3c53e commit 6026a57

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

Pythonwin/pywin/mfc/dialog.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import win32con
99
import win32ui
1010

11-
# sob - 2to3 doesn't see this as a relative import :(
12-
from pywin.mfc import window
11+
from . import window
1312

1413

1514
def dllFromDll(dllid):
@@ -258,21 +257,19 @@ def GetSimpleInput(prompt, defValue="", title=None):
258257
# uses a simple dialog to return a string object.
259258
if title is None:
260259
title = win32ui.GetMainFrame().GetWindowText()
261-
# 2to3 insists on converting 'Dialog.__init__' to 'tkinter.dialog...'
262-
DlgBaseClass = Dialog
263260

264-
class DlgSimpleInput(DlgBaseClass):
261+
class DlgSimpleInput(Dialog):
265262
def __init__(self, prompt, defValue, title):
266263
self.title = title
267-
DlgBaseClass.__init__(self, win32ui.IDD_SIMPLE_INPUT)
264+
Dialog.__init__(self, win32ui.IDD_SIMPLE_INPUT)
268265
self.AddDDX(win32ui.IDC_EDIT1, "result")
269266
self.AddDDX(win32ui.IDC_PROMPT1, "prompt")
270267
self._obj_.data["result"] = defValue
271268
self._obj_.data["prompt"] = prompt
272269

273270
def OnInitDialog(self):
274271
self.SetWindowText(self.title)
275-
return DlgBaseClass.OnInitDialog(self)
272+
return Dialog.OnInitDialog(self)
276273

277274
dlg = DlgSimpleInput(prompt, defValue, title)
278275
if dlg.DoModal() != win32con.IDOK:

0 commit comments

Comments
 (0)