Commits

Ronald Oussoren committed 12a24c0

Hardcode knowlegdge about compability aliases for module names in the email package.

In python 2.5 the email package moved to PEP8 compliant names for modules, but
kept the old names alive through some code in email.__init__. This patches
teaches modulegraph about that code. The compatibility aliases are not present
in python 3.x.

With this patch it is possible to remove a heavy-handed recipe from py2app.

Comments (0)

Files changed (2)

doc/changelog.rst

 Features
 ........
 
-* ...
+* Hardcode knowlegde about the compatibility aliases in the email
+  module (for python 2.5 upto 3.0). 
+
+  This makes it possible to remove a heavy-handed recipe from py2app.
 
 0.10.4
 ------

modulegraph/find_modules.py

 
     }
 
+    if sys.version_info[0] == 2 and sys.version_info[1] >= 5:
+        result.update({
+            "email.base64MIME":         Alias("email.base64mime"),
+            "email.Charset":            Alias("email.charset"),
+            "email.Encoders":           Alias("email.encoders"),
+            "email.Errors":             Alias("email.errors"),
+            "email.Feedparser":         Alias("email.feedParser"),
+            "email.Generator":          Alias("email.generator"),
+            "email.Header":             Alias("email.header"),
+            "email.Iterators":          Alias("email.iterators"),
+            "email.Message":            Alias("email.message"),
+            "email.Parser":             Alias("email.parser"),
+            "email.quopriMIME":         Alias("email.quoprimime"),
+            "email.Utils":              Alias("email.utils"),
+            "email.MIMEAudio":          Alias("email.mime.audio"),
+            "email.MIMEBase":           Alias("email.mime.base"),
+            "email.MIMEImage":          Alias("email.mime.image"),
+            "email.MIMEMessage":        Alias("email.mime.message"),
+            "email.MIMEMultipart":      Alias("email.mime.multipart"),
+            "email.MIMENonMultipart":   Alias("email.mime.nonmultipart"),
+            "email.MIMEText":           Alias("email.mime.text"),
+        })
+
     if sys.version_info[:2] >= (2, 5):
         result["_elementtree"] = ["pyexpat"]