[New-bugs-announce] [issue25502] unnecessary re-imports

John Mark Vandenberg report at bugs.python.org
Wed Oct 28 21:55:45 EDT 2015


New submission from John Mark Vandenberg:

The following four modules re-import another module unnecessarily as it is already imported in the global scope.

Lib/getpass.py : msvcrt
Lib/pickletools.py : sys
Lib/smtplib.py : sys
PC/testpy.py : os

In each case, the import being removed in the attached patch existed in the source code before the import which now occurs first.  i.e. an import was added and the same import elsewhere in the module was not removed.

----------
components: Library (Lib)
files: re-imports.diff
keywords: patch
messages: 253651
nosy: John.Mark.Vandenberg
priority: normal
severity: normal
status: open
title: unnecessary re-imports
versions: Python 3.6
Added file: http://bugs.python.org/file40882/re-imports.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25502>
_______________________________________


More information about the New-bugs-announce mailing list