Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Lib/test/test_gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ def _test_plural_forms(self, ngettext, gettext,
x = ngettext(singular, plural, None)
self.assertEqual(x, tplural)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_forms(self):
self._test_plural_forms(
self.ngettext, self.gettext,
Expand All @@ -396,7 +395,6 @@ def test_plural_forms(self):
'%d file deleted', '%d files deleted',
'%d file deleted', '%d files deleted')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_context_forms(self):
ngettext = partial(self.npgettext, 'With context')
gettext = partial(self.pgettext, 'With context')
Expand All @@ -409,7 +407,6 @@ def test_plural_context_forms(self):
'%d file deleted', '%d files deleted',
'%d file deleted', '%d files deleted')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_wrong_context_forms(self):
self._test_plural_forms(
partial(self.npgettext, 'Unknown context'),
Expand Down Expand Up @@ -442,7 +439,6 @@ def setUp(self):
self.pgettext = partial(gettext.dpgettext, 'gettext')
self.npgettext = partial(gettext.dnpgettext, 'gettext')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_forms_wrong_domain(self):
self._test_plural_forms(
partial(gettext.dngettext, 'unknown'),
Expand All @@ -451,7 +447,6 @@ def test_plural_forms_wrong_domain(self):
'There is %s file', 'There are %s files',
numbers_only=False)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_context_forms_wrong_domain(self):
self._test_plural_forms(
partial(gettext.dnpgettext, 'unknown', 'With context'),
Expand All @@ -472,7 +467,6 @@ def setUp(self):
self.pgettext = t.pgettext
self.npgettext = t.npgettext

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_forms_null_translations(self):
t = gettext.NullTranslations()
self._test_plural_forms(
Expand All @@ -481,7 +475,6 @@ def test_plural_forms_null_translations(self):
'There is %s file', 'There are %s files',
numbers_only=False)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_plural_context_forms_null_translations(self):
t = gettext.NullTranslations()
self._test_plural_forms(
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,6 @@ def test_range_traceback_toplevel_frame(self):
class TestDecorators(GetSourceBase):
fodderModule = mod2

@unittest.expectedFailure # TODO: RUSTPYTHON; pass
def test_wrapped_decorator(self):
self.assertSourceEqual(mod2.wrapped, 14, 17)

Expand Down Expand Up @@ -1259,7 +1258,6 @@ def test_class(self):
class TestComplexDecorator(GetSourceBase):
fodderModule = mod2

@unittest.expectedFailure # TODO: RUSTPYTHON; return foo + bar()
def test_parens_in_decorator(self):
self.assertSourceEqual(self.fodderModule.complex_decorated, 273, 275)

Expand Down
8 changes: 8 additions & 0 deletions crates/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4246,11 +4246,19 @@ impl Compiler {
is_async: bool,
type_params: Option<&ast::TypeParams>,
) -> CompileResult<()> {
// Save the source range of the `def` line before compiling decorators/defaults,
// so that the function code object gets the correct co_firstlineno.
let def_source_range = self.current_source_range;

self.prepare_decorators(decorator_list)?;

// compile defaults and return funcflags
let funcflags = self.compile_default_arguments(parameters)?;

// Restore the `def` line range so that enter_function → push_output → get_source_line_number()
// records the `def` keyword's line as co_firstlineno, not the last default-argument line.
self.set_source_range(def_source_range);

let is_generic = type_params.is_some();
let mut num_typeparam_args = 0;

Expand Down
Loading