mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fixed Python 3.2/3.3 compatibility
This commit is contained in:
9
src/pretix/helpers/importlib.py
Normal file
9
src/pretix/helpers/importlib.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import importlib.util
|
||||
import sys
|
||||
|
||||
|
||||
def module_exists(modname):
|
||||
if sys.version_info[0:1] >= (3, 4):
|
||||
return bool(importlib.util.find_spec(modname))
|
||||
else:
|
||||
return bool(importlib.find_loader(modname))
|
||||
Reference in New Issue
Block a user