Bugfix on Python3 .8 AttributeError: module 'importlib' has no attribute 'util'

This commit is contained in:
2press 2020-03-27 14:08:26 +01:00 committed by GitHub
commit b7099f2867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,8 +93,8 @@ from uuid import uuid4 as uniquename
# imp is deprecated in Python3 in favour of importlib
if sys.version_info.major == 3:
import importlib
pyc_magic = importlib.util.MAGIC_NUMBER
from importlib.util import MAGIC_NUMBER
pyc_magic = MAGIC_NUMBER
else:
import imp
pyc_magic = imp.get_magic()