You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
245 B

4 years ago
  1. import importlib
  2. try:
  3. import importlib.util
  4. except ImportError:
  5. pass
  6. try:
  7. module_from_spec = importlib.util.module_from_spec
  8. except AttributeError:
  9. def module_from_spec(spec):
  10. return spec.loader.load_module(spec.name)