File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -290,10 +290,16 @@ def get_lambda_bootstrap():
290
290
# sys.modules['__main__'].__file__ == sys.modules['bootstrap'].__file__
291
291
# sys.modules['__main__'] is not sys.modules['bootstrap']
292
292
#
293
+ # On container builds using the `aws-lambda-python-runtime-interface-client`
294
+ # (awslamdaric) module, bootstrap is located in sys.modules['__main__'].bootstrap
295
+ #
293
296
# Such a setup would then make all monkeypatches useless.
294
297
if "bootstrap" in sys .modules :
295
298
return sys .modules ["bootstrap" ]
296
299
elif "__main__" in sys .modules :
300
+ if hasattr (sys .modules ["__main__" ], "bootstrap" ):
301
+ # awslambdaric python module in container builds
302
+ return sys .modules ["__main__" ].bootstrap # type: ignore
297
303
return sys .modules ["__main__" ]
298
304
else :
299
305
return None
You can’t perform that action at this time.
0 commit comments