diff --git a/.chronus/changes/fix_dup_read-2024-6-10-14-46-24.md b/.chronus/changes/fix_dup_read-2024-6-10-14-46-24.md new file mode 100644 index 0000000000..76ef2b2386 --- /dev/null +++ b/.chronus/changes/fix_dup_read-2024-6-10-14-46-24.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@azure-tools/typespec-python" +--- + +clean up code in operation.py \ No newline at end of file diff --git a/packages/typespec-python/generator/pygen/codegen/models/operation.py b/packages/typespec-python/generator/pygen/codegen/models/operation.py index 362befe8bd..93391e8792 100644 --- a/packages/typespec-python/generator/pygen/codegen/models/operation.py +++ b/packages/typespec-python/generator/pygen/codegen/models/operation.py @@ -343,7 +343,7 @@ def imports( # pylint: disable=too-many-branches, disable=too-many-statements "ResourceExistsError", "ResourceNotModifiedError", ] - if not (self.stream_value is False): + if self.stream_value: errors.extend(["StreamConsumedError", "StreamClosedError"]) for error in errors: file_import.add_submodule_import("exceptions", error, ImportType.SDKCORE)