Skip to content

Commit 5a067c7

Browse files
committed
fix exception on invoke when no env vars found in config
1 parent 7053c05 commit 5a067c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

aws_lambda/aws_lambda.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ def invoke(src, alt_event=None, verbose=False):
144144

145145
# Load environment variables from the config file into the actual
146146
# environment.
147-
for key, value in cfg.get('environment_variables').items():
148-
os.environ[key] = value
147+
env_vars = cfg.get('environment_variables')
148+
if env_vars:
149+
for key, value in env_vars.items():
150+
os.environ[key] = value
149151

150152
# Load and parse event file.
151153
if alt_event:

0 commit comments

Comments
 (0)