Skip to content

Commit 258fb45

Browse files
authored
Merge pull request nficano#72 from rizkiwicaksono/fix-invoke-failed-when-no-env-vars-found
fix exception on invoke when no env vars found in config
2 parents a90098f + 5a067c7 commit 258fb45

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
@@ -170,8 +170,10 @@ def invoke(src, alt_event=None, verbose=False):
170170

171171
# Load environment variables from the config file into the actual
172172
# environment.
173-
for key, value in cfg.get('environment_variables').items():
174-
os.environ[key] = value
173+
env_vars = cfg.get('environment_variables')
174+
if env_vars:
175+
for key, value in env_vars.items():
176+
os.environ[key] = value
175177

176178
# Load and parse event file.
177179
if alt_event:

0 commit comments

Comments
 (0)