]> granicus.if.org Git - python/commitdiff
remove duplicated imports (closes #25502)
authorBenjamin Peterson <benjamin@python.org>
Thu, 29 Oct 2015 06:15:13 +0000 (23:15 -0700)
committerBenjamin Peterson <benjamin@python.org>
Thu, 29 Oct 2015 06:15:13 +0000 (23:15 -0700)
Lib/getpass.py
Lib/pickletools.py
Lib/smtplib.py
PC/testpy.py
Parser/asdl_c.py

index 7c4e976174ab9d4075370cbed9898f5368b1d59a..be511211585a484ae9861022317ed189a5ae0ea3 100644 (file)
@@ -99,7 +99,7 @@ def win_getpass(prompt='Password: ', stream=None):
     """Prompt for password with echo off, using Windows getch()."""
     if sys.stdin is not sys.__stdin__:
         return fallback_getpass(prompt, stream)
-    import msvcrt
+
     for c in prompt:
         msvcrt.putwch(c)
     pw = ""
index cf5df4158a0ac4fe4cd94d106e18a7d16a87ebc5..155bd5b4ab34520839fd84ce8c597cb852a7ec48 100644 (file)
@@ -2793,7 +2793,7 @@ def _test():
     return doctest.testmod()
 
 if __name__ == "__main__":
-    import sys, argparse
+    import argparse
     parser = argparse.ArgumentParser(
         description='disassemble one or more pickle files')
     parser.add_argument(
index 4fe6aaf8e12b107399aca6a42ffb1f082e1193ed..7e348757f3ec3b7c17cad38a25c72fdb83825aec 100755 (executable)
@@ -1080,8 +1080,6 @@ class LMTP(SMTP):
 # Test the sendmail method, which tests most of the others.
 # Note: This always sends to localhost.
 if __name__ == '__main__':
-    import sys
-
     def prompt(prompt):
         sys.stdout.write(prompt + ": ")
         sys.stdout.flush()
index 36f92009a4f32614c23a94893e4f88fa77dad120..4ef3d4f793df202c0bbe593b3a5d0fc0d9027c63 100644 (file)
@@ -18,8 +18,6 @@ except:
   a PC, you should add the dos_8x3 directory to your PYTHONPATH.""")
     sys.exit(1)
 
-import os
-
 for dir in sys.path:
     file = os.path.join(dir, "os.py")
     if os.path.isfile(file):
index a5e35d93fd29d26d55c3c34c00fd7ea663f2a8d2..79e834b3dc89a598857860835bb3ac9e7d82a275 100755 (executable)
@@ -1289,7 +1289,6 @@ def main(srcfile, dump_module=False):
         f.close()
 
 if __name__ == "__main__":
-    import sys
     import getopt
 
     INC_DIR = ''