Skip to content Skip to sidebar Skip to footer

Aws | Syntax Error In Module': Invalid Syntax

I have created python script which is uploaded as a zip file in AWS Lambda function with stompy libraries bundled in them. Logs for python 2.7:- Response: null Request ID: 'c33483

Solution 1:

EDIT: As pointed by @Petesh, the issue comes from stompy(external library), which hasn't been ported to Python3.

If you check the source code, you can find this:

except socket.timeout, exc:

which is invalid syntax for python3+

If you run your Lambdas in python3.6/3.7 environment, the syntax is invalid.

The issue might go away if you choose python 2.7, but you will also have to adjust your code, libraries, etc.

Post a Comment for "Aws | Syntax Error In Module': Invalid Syntax"