Skip to content

Recent Python versions break JIT tests (locally defined classes don't work well, even with global) #49617

@t-vi

Description

@t-vi

🐛 Bug

Recent Python versions updated the inspect.getsource* mechanism for classes. This breaks many of our JIT tests.

To Reproduce

Run test/test_jit.py on Python 3.9.

Expected behavior

Tests pass.

Environment

Python 3.9
PyTorch master

Additional context

Python bug report: https://bugs.python.org/issue42666

My impression is that it's a case of "Don't do that then".

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @gmagogsfm

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions