Fix case where __virtulname__ falls back to True

This commit is contained in:
Mike Place 2014-09-15 15:27:49 -06:00
parent cf32d4e55b
commit 7577520ad8

View File

@ -1114,7 +1114,8 @@ class Loader(object):
# If the __virtual__ function returns True and __virtualname__ is set then use it # If the __virtual__ function returns True and __virtualname__ is set then use it
elif virtual is True and virtualname != module_name: elif virtual is True and virtualname != module_name:
module_name = getattr(mod, '__virtualname__', virtual) if virtualname is not True:
module_name = virtualname
except KeyError: except KeyError:
# Key errors come out of the virtual function when passing # Key errors come out of the virtual function when passing