From 515f0bf9c2f59e2d2324add8d8cb3de5e419ae12 Mon Sep 17 00:00:00 2001 From: matheusfgoncalves95 Date: Mon, 13 May 2024 16:18:55 +0200 Subject: [PATCH] Adding generator_stop to compile_future_features (#5320) * Adding generator_stop to compile_future_features. * Removing expected failure from PEP 479 unit test. --- Lib/test/test_contextlib.py | 2 -- compiler/codegen/src/compile.rs | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index a9612c424..71215ecf5 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -197,8 +197,6 @@ class ContextManagerTestCase(unittest.TestCase): else: self.fail(f'{stop_exc} was suppressed') - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_contextmanager_except_pep479(self): code = """\ from __future__ import generator_stop diff --git a/compiler/codegen/src/compile.rs b/compiler/codegen/src/compile.rs index 9f4f3df82..7b912f43d 100644 --- a/compiler/codegen/src/compile.rs +++ b/compiler/codegen/src/compile.rs @@ -2904,8 +2904,7 @@ impl Compiler { match feature.name.as_str() { // Python 3 features; we've already implemented them by default "nested_scopes" | "generators" | "division" | "absolute_import" - | "with_statement" | "print_function" | "unicode_literals" => {} - // "generator_stop" => {} + | "with_statement" | "print_function" | "unicode_literals" | "generator_stop" => {} "annotations" => self.future_annotations = true, other => { return Err(self.error(CodegenErrorType::InvalidFutureFeature(other.to_owned())))