[Python-checkins] r63410 - python/trunk/Lib/tkinter/simpledialog.py

georg.brandl python-checkins at python.org
Sat May 17 17:30:35 CEST 2008


Author: georg.brandl
Date: Sat May 17 17:30:35 2008
New Revision: 63410

Log:
Move imports to file top.


Modified:
   python/trunk/Lib/tkinter/simpledialog.py

Modified: python/trunk/Lib/tkinter/simpledialog.py
==============================================================================
--- python/trunk/Lib/tkinter/simpledialog.py	(original)
+++ python/trunk/Lib/tkinter/simpledialog.py	Sat May 17 17:30:35 2008
@@ -254,8 +254,8 @@
                  parent = None):
 
         if not parent:
-            import Tkinter
-            parent = Tkinter._default_root
+            import tkinter
+            parent = tkinter._default_root
 
         self.prompt   = prompt
         self.minvalue = minvalue
@@ -285,12 +285,12 @@
 
     def validate(self):
 
-        import tkMessageBox
+        from tkinter import messagebox
 
         try:
             result = self.getresult()
         except ValueError:
-            tkMessageBox.showwarning(
+            messagebox.showwarning(
                 "Illegal value",
                 self.errormessage + "\nPlease try again",
                 parent = self
@@ -298,7 +298,7 @@
             return 0
 
         if self.minvalue is not None and result < self.minvalue:
-            tkMessageBox.showwarning(
+            messagebox.showwarning(
                 "Too small",
                 "The allowed minimum value is %s. "
                 "Please try again." % self.minvalue,
@@ -307,7 +307,7 @@
             return 0
 
         if self.maxvalue is not None and result > self.maxvalue:
-            tkMessageBox.showwarning(
+            messagebox.showwarning(
                 "Too large",
                 "The allowed maximum value is %s. "
                 "Please try again." % self.maxvalue,


More information about the Python-checkins mailing list