diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2011-11-04 07:29:17 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2011-11-04 07:29:17 (GMT) |
commit | 54540ec917a47c39328e87b1f4ddf83adeca2f5c (patch) | |
tree | d4cef1dbff88af3933fd0cb4572d272e77a9b9e7 /Lib/tkinter | |
parent | c53ae589548e37c4bd86f03294a27667978a51f8 (diff) | |
download | cpython-54540ec917a47c39328e87b1f4ddf83adeca2f5c.zip cpython-54540ec917a47c39328e87b1f4ddf83adeca2f5c.tar.gz cpython-54540ec917a47c39328e87b1f4ddf83adeca2f5c.tar.bz2 |
Remove redundant imports.
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/__init__.py | 5 | ||||
-rw-r--r-- | Lib/tkinter/filedialog.py | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index e58cc35..f4f9583 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -1159,7 +1159,6 @@ class Misc: return (e,) def _report_exception(self): """Internal function.""" - import sys exc, val, tb = sys.exc_info() root = self._root() root.report_callback_exception(exc, val, tb) @@ -1663,7 +1662,7 @@ class Tk(Misc, Wm): # ensure that self.tk is always _something_. self.tk = None if baseName is None: - import sys, os + import os baseName = os.path.basename(sys.argv[0]) baseName, ext = os.path.splitext(baseName) if ext not in ('.py', '.pyc', '.pyo'): @@ -1737,7 +1736,7 @@ class Tk(Misc, Wm): exec(open(base_py).read(), dir) def report_callback_exception(self, exc, val, tb): """Internal function. It reports exception on sys.stderr.""" - import traceback, sys + import traceback sys.stderr.write("Exception in Tkinter callback\n") sys.last_type = exc sys.last_value = val diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py index 98d2d5c..3ffb252 100644 --- a/Lib/tkinter/filedialog.py +++ b/Lib/tkinter/filedialog.py @@ -306,7 +306,6 @@ class _Dialog(commondialog.Dialog): def _fixresult(self, widget, result): if result: # keep directory and filename until next time - import os # convert Tcl path objects to strings try: result = result.string @@ -333,7 +332,6 @@ class Open(_Dialog): # multiple results: result = tuple([getattr(r, "string", r) for r in result]) if result: - import os path, file = os.path.split(result[0]) self.options["initialdir"] = path # don't set initialfile or filename, as we have multiple of these |