diff options
author | Spencer McIntyre <zeroSteiner@gmail.com> | 2016-06-16 21:08:45 -0400 |
---|---|---|
committer | Spencer McIntyre <zeroSteiner@gmail.com> | 2016-06-16 21:08:45 -0400 |
commit | 9e5764f1316ffc8819dd221153d87158a33ec895 (patch) | |
tree | c68a49e229d5841a049f41ef91dc08163ce01a4e | |
parent | e75881a99aba03c667c4bfbaa272dbf0d10f3862 (diff) | |
download | pluginbase-9e5764f1316ffc8819dd221153d87158a33ec895.tar.gz |
Set level to the Python version dependent value
-rw-r--r-- | pluginbase.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pluginbase.py b/pluginbase.py index 000757d..16a707c 100644 --- a/pluginbase.py +++ b/pluginbase.py @@ -389,7 +389,10 @@ class _ImportHook(ModuleType): self.enabled = False def plugin_import(self, name, globals=None, locals=None, - fromlist=None, level=0): + fromlist=None, level=None): + if level is None: + # set the level to the default value specific to this python version + level = -1 if PY2 else 0 import_name = name if self.enabled: ref_globals = globals |