diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-06-29 10:44:41 -0700 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-06-29 10:44:41 -0700 |
commit | b2cb78a8a0a2da037e56d981e22450089240e6e4 (patch) | |
tree | 3904634bf650c4dc9134eed8e41a2dc9507da2c2 | |
parent | e8a1a60a87ffa293aa6b1eeda2496cb5ca36971c (diff) | |
download | six-b2cb78a8a0a2da037e56d981e22450089240e6e4.tar.gz |
account for __spec__ possibly being None (fixes #77)
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | six.py | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -6,6 +6,8 @@ This file lists the changes in each six version. Development version ------------------- +- Issue #77: Fix import six on Python 3.4 with a custom loader. + - Issue #74: six.moves.xmlrpc_server should map to SimpleXMLRPCServer on Python 2 as documented not xmlrpclib. @@ -734,10 +734,8 @@ def add_metaclass(metaclass): # Turn this module into a package. __path__ = [] # required for PEP 302 and PEP 451 __package__ = __name__ # see PEP 366 @ReservedAssignment -try: +if globals().get("__spec__") is not None: __spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable -except NameError: - pass # Remove other six meta path importers, since they cause problems. This can # happen if six is removed from sys.modules and then reloaded. (Setuptools does # this for some reason.) |