Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6cd441d

Browse files
committed
Add dead imports of modules that are "magically" imported.
1 parent bbe500e commit 6cd441d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Lib/codecs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ def make_encoding_map(decoding_map):
575575
m[v] = None
576576
return m
577577

578+
# Tell modulefinder that using codecs probably needs the encodings
579+
# package
580+
_false = 0
581+
if _false:
582+
import encodings
583+
578584
### Tests
579585

580586
if __name__ == '__main__':

Lib/xml/sax/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def parseString(string, handler, errorHandler=ErrorHandler()):
5353

5454
default_parser_list = ["xml.sax.expatreader"]
5555

56+
# tell modulefinder that importing sax potentially imports expatreader
57+
_false = 0
58+
if _false:
59+
import xml.sax.expatreader
60+
5661
import os, string, sys
5762
if os.environ.has_key("PY_SAX_PARSER"):
5863
default_parser_list = string.split(os.environ["PY_SAX_PARSER"], ",")

0 commit comments

Comments
 (0)