mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 14:56:53 +02:00
24 lines
730 B
Diff
24 lines
730 B
Diff
replace deprecated imp module
|
|
|
|
diff --git a/snapshottest/module.py b/snapshottest/module.py
|
|
index 2f02c83..b0959ed 100644
|
|
--- a/snapshottest/module.py
|
|
+++ b/snapshottest/module.py
|
|
@@ -1,7 +1,7 @@
|
|
import codecs
|
|
import errno
|
|
import os
|
|
-import imp
|
|
+from importlib.machinery import SourceFileLoader
|
|
from collections import defaultdict
|
|
import logging
|
|
|
|
@@ -29,7 +29,7 @@ class SnapshotModule(object):
|
|
|
|
def load_snapshots(self):
|
|
try:
|
|
- source = imp.load_source(self.module, self.filepath)
|
|
+ source = SourceFileLoader(self.module, self.filepath).load_module()
|
|
# except FileNotFoundError: # Python 3
|
|
except (IOError, OSError) as err:
|
|
if err.errno == errno.ENOENT:
|