Issue #27891: Consistently group and sort imports within idlelib modules.
diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py
index f9f558d..c225dd9 100644
--- a/Lib/idlelib/macosx.py
+++ b/Lib/idlelib/macosx.py
@@ -2,9 +2,10 @@
 A number of functions that enhance IDLE on Mac OSX.
 """
 from sys import platform  # Used in _init_tk_type, changed by test.
-import tkinter
 import warnings
 
+import tkinter
+
 
 ## Define functions that query the Mac graphics type.
 ## _tk_type and its initializer are private to this section.