[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(): | def get_test_zip_file(): | ||||||
|     zip_output = io.BytesIO() |     zip_output = io.BytesIO() | ||||||
|     with zipfile.ZipFile(zip_output, 'w') as f: |     zip_file = zipfile.ZipFile(zip_output, 'w') | ||||||
|         f.writestr('lambda_function.py', b'''\ |     zip_file.writestr('lambda_function.py', b'''\ | ||||||
| def handler(event, context): | def handler(event, context): | ||||||
|     return "hello world" |     return "hello world" | ||||||
| ''') | ''') | ||||||
|  |     zip_file.close() | ||||||
|     zip_output.seek(0) |     zip_output.seek(0) | ||||||
|     return zip_output.read() |     return zip_output.read() | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user