Skip to content

Commit

Permalink
chore(lambda): invalid python sample code generated (#13036)
Browse files Browse the repository at this point in the history
jsii-rosettta has a bug which renders invalid python when a newline is included in a string literal. Remove that string literal for now.

Fixes #13035


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Elad Ben-Israel authored Feb 14, 2021
1 parent 4684c83 commit fd808b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"ZipFile": "exports.handler = async () => {\nconsole.log('hello world');\n};"
"ZipFile": "exports.handler = async () => { console.log('hello world'); };"
},
"Handler": "index.handler",
"Role": {
Expand Down Expand Up @@ -161,4 +161,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda/test/integ.autoscaling.lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestStack extends cdk.Stack {
super(scope, id);

const fn = new lambda.Function(this, 'MyLambda', {
code: new lambda.InlineCode('exports.handler = async () => {\nconsole.log(\'hello world\');\n};'),
code: new lambda.InlineCode('exports.handler = async () => { console.log(\'hello world\'); };'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
});
Expand Down Expand Up @@ -50,4 +50,4 @@ const app = new cdk.App();

new TestStack(app, 'aws-lambda-autoscaling');

app.synth();
app.synth();

0 comments on commit fd808b4

Please sign in to comment.