[lambda] Do not use ZipFile as a context manager (it is not supported in Python 2.6)
This commit is contained in:
parent
ac66a8eb87
commit
45d91bf963
@ -13,11 +13,12 @@ from moto import mock_lambda, mock_s3
|
||||
|
||||
def get_test_zip_file():
|
||||
zip_output = io.BytesIO()
|
||||
with zipfile.ZipFile(zip_output, 'w') as f:
|
||||
f.writestr('lambda_function.py', b'''\
|
||||
zip_file = zipfile.ZipFile(zip_output, 'w')
|
||||
zip_file.writestr('lambda_function.py', b'''\
|
||||
def handler(event, context):
|
||||
return "hello world"
|
||||
''')
|
||||
zip_file.close()
|
||||
zip_output.seek(0)
|
||||
return zip_output.read()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user