Commits

Floris Bruynooghe committed df47d01

Handle unicode module names

When the module name is given as unicode things should just work.
This can be common when using the unicode_literals __future__ import
for example.

Comments (0)

Files changed (2)

         def __delattr__(self, name):
             delattr(getmod(), name)
 
-    return AliasModule(modname)
+    return AliasModule(str(modname))
     assert "<AliasModule 'mymod' for 'pprint.PrettyPrinter'>" == r
     assert am.format
 
+def test_aliasmodule_unicode():
+    am = apipkg.AliasModule(py.builtin._totext("mymod"), "pprint")
+    assert am
+
 def test_aliasmodule_repr():
     am = apipkg.AliasModule("mymod", "sys")
     r = repr(am)