Skip to content

Commit 2165be0

Browse files
committed
[Dynamo] Require Python 3.12.4+ for the type.__type_params__ check
test_type_dunder_attr_access, and its _dynamic_shapes and _nested_graph_breaks clones, expect type.__type_params__ == () on any Python 3.12. Before 3.12.4, CPython returned the attribute's own descriptor for `type` (python/cpython#119011), so the eager call fails on Ubuntu 24.04's stock Python 3.12.3, which the rocm-preview image uses.
1 parent 4a21eb6 commit 2165be0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎test/dynamo/test_functions.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5927,7 +5927,8 @@ def fn(x):
59275927
raise AssertionError(type.__name__)
59285928
if not type.__doc__.startswith("type("):
59295929
raise AssertionError(type.__doc__)
5930-
if sys.version_info >= (3, 12):
5930+
# Before 3.12.4 this returned its own descriptor (CPython gh-119011).
5931+
if sys.version_info >= (3, 12, 4):
59315932
if type.__type_params__ != ():
59325933
raise AssertionError(type.__type_params__)
59335934
return x + 1

0 commit comments

Comments
 (0)