##// END OF EJS Templates
Remove clearly marked python 2 imports.
Terry Davis -
Show More
@@ -361,10 +361,8 b' class Pdb(OldPdb):'
361 print("Context must be a positive integer", file=self.stdout)
361 print("Context must be a positive integer", file=self.stdout)
362 except (TypeError, ValueError):
362 except (TypeError, ValueError):
363 print("Context must be a positive integer", file=self.stdout)
363 print("Context must be a positive integer", file=self.stdout)
364 try:
364
365 import reprlib # Py 3
365 import reprlib
366 except ImportError:
367 import repr as reprlib # Py 2
368
366
369 ret = []
367 ret = []
370
368
@@ -48,10 +48,7 b' class PdbTestInput(object):'
48 #-----------------------------------------------------------------------------
48 #-----------------------------------------------------------------------------
49
49
50 def test_longer_repr():
50 def test_longer_repr():
51 try:
51 from reprlib import repr as trepr
52 from reprlib import repr as trepr # Py 3
53 except ImportError:
54 from repr import repr as trepr # Py 2
55
52
56 a = '1234567890'* 7
53 a = '1234567890'* 7
57 ar = "'1234567890123456789012345678901234567890123456789012345678901234567890'"
54 ar = "'1234567890123456789012345678901234567890123456789012345678901234567890'"
@@ -266,10 +266,7 b' class IFrame(object):'
266 def _repr_html_(self):
266 def _repr_html_(self):
267 """return the embed iframe"""
267 """return the embed iframe"""
268 if self.params:
268 if self.params:
269 try:
269 from urllib.parse import urlencode
270 from urllib.parse import urlencode # Py 3
271 except ImportError:
272 from urllib import urlencode
273 params = "?" + urlencode(self.params)
270 params = "?" + urlencode(self.params)
274 else:
271 else:
275 params = ""
272 params = ""
@@ -509,10 +509,7 b' class TkInputHook(InputHookBase):'
509 warn("This function is deprecated since IPython 5.0 and will be removed in future versions.",
509 warn("This function is deprecated since IPython 5.0 and will be removed in future versions.",
510 DeprecationWarning, stacklevel=2)
510 DeprecationWarning, stacklevel=2)
511 if app is None:
511 if app is None:
512 try:
512 from tkinter import Tk
513 from tkinter import Tk # Py 3
514 except ImportError:
515 from Tkinter import Tk # Py 2
516 app = Tk()
513 app = Tk()
517 app.withdraw()
514 app.withdraw()
518 self.manager.apps[GUI_TK] = app
515 self.manager.apps[GUI_TK] = app
General Comments 0
You need to be logged in to leave comments. Login now