Skip to content

Commit 427c596

Browse files
committed
fix tests
1 parent f35b56a commit 427c596

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ clean-build:
4747
find . -name '*.egg-info' -exec rm -fr {} +
4848
find . -name '*.egg' -exec rm -f {} +
4949
find . -name '*.DS_Store' -exec rm -f {} +
50+
rm -f requirements.*
5051

5152
clean-pyc:
5253
find . -name '*.pyc' -exec rm -f {} +

aws_lambda/aws_lambda.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import time
88
from collections import defaultdict
9-
from imp import load_source
9+
1010
from shutil import copy
1111
from shutil import copyfile
1212
from shutil import copystat
@@ -16,6 +16,7 @@
1616
import boto3
1717
import botocore
1818
import yaml
19+
import sys
1920

2021
from .helpers import archive
2122
from .helpers import get_environment_variable_value
@@ -34,6 +35,21 @@
3435
log = logging.getLogger(__name__)
3536

3637

38+
def load_source(module_name, module_path):
39+
"""Loads a python module from the path of the corresponding file."""
40+
41+
if sys.version_info[0] == 3 and sys.version_info[1] >= 5:
42+
import importlib.util
43+
spec = importlib.util.spec_from_file_location(module_name, module_path)
44+
module = importlib.util.module_from_spec(spec)
45+
spec.loader.exec_module(module)
46+
elif sys.version_info[0] == 3 and sys.version_info[1] < 5:
47+
import importlib.machinery
48+
loader = importlib.machinery.SourceFileLoader(module_name, module_path)
49+
module = loader.load_module()
50+
return module
51+
52+
3753
def cleanup_old_versions(
3854
src, keep_last_versions, config_file="config.yaml", profile_name=None,
3955
):

0 commit comments

Comments
 (0)