trfix_emaillib.patch 941 B

12345678910111213141516171819202122232425
  1. diff -Nur Python-2.5.2-old/Lib/email/__init__.py Python-2.5.2/Lib/email/__init__.py
  2. --- Python-2.5.2-old/Lib/email/__init__.py 2008-07-02 18:58:15.000000000 +0300
  3. +++ Python-2.5.2/Lib/email/__init__.py 2008-07-02 18:59:28.000000000 +0300
  4. @@ -109,15 +109,18 @@
  5. 'Text',
  6. ]
  7. +import string
  8. +lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase)
  9. +
  10. for _name in _LOWERNAMES:
  11. - importer = LazyImporter(_name.lower())
  12. + importer = LazyImporter(_name.translate(lower_map))
  13. sys.modules['email.' + _name] = importer
  14. setattr(sys.modules['email'], _name, importer)
  15. import email.mime
  16. for _name in _MIMENAMES:
  17. - importer = LazyImporter('mime.' + _name.lower())
  18. + importer = LazyImporter('mime.' + _name.translate(lower_map))
  19. sys.modules['email.MIME' + _name] = importer
  20. setattr(sys.modules['email'], 'MIME' + _name, importer)
  21. setattr(sys.modules['email.mime'], _name, importer)