From 090d9ddc6a29b4cb8e68f9cd803eac82c38eaa40 Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Thu, 20 May 2021 11:45:20 -0700 Subject: [PATCH] fix(python): module import fails: NameError: name 'List' is not defined --- packages/jsii-pacmak/lib/targets/python.ts | 2 +- .../generated-code/__snapshots__/target-python.test.ts.snap | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 868d3c0840..f68ae2264b 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1607,7 +1607,7 @@ class PythonModule implements PythonType { } code.unindent(']'); } else { - code.line('__all__: List[typing.Any] = []'); + code.line('__all__: typing.List[typing.Any] = []'); } // Finally, we'll use publication to ensure that all of the non-public names diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap index 0612a6732c..e58b7a6db6 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.ts.snap @@ -10589,7 +10589,7 @@ import typing_extensions from .._jsii import * -__all__: List[typing.Any] = [] +__all__: typing.List[typing.Any] = [] publication.publish() @@ -10806,7 +10806,7 @@ import typing_extensions from .._jsii import * -__all__: List[typing.Any] = [] +__all__: typing.List[typing.Any] = [] publication.publish() @@ -11163,7 +11163,7 @@ import typing_extensions from .._jsii import * -__all__: List[typing.Any] = [] +__all__: typing.List[typing.Any] = [] publication.publish()