@@ -3677,14 +3677,14 @@ def __ror__(self, other):
36773677 return typing .Union [other , self ]
36783678
36793679
3680- # Breakpoint: https://github.com/python/cpython/pull/124795
3681- if sys .version_info >= (3 , 14 ):
3680+ # Breakpoint: https://github.com/python/cpython/pull/149172
3681+ if sys .version_info >= (3 , 15 ):
36823682 TypeAliasType = typing .TypeAliasType
3683- # <=3.13
3683+ # <=3.14
36843684else :
36853685 # Breakpoint: https://github.com/python/cpython/pull/103764
36863686 if sys .version_info >= (3 , 12 ):
3687- # 3.12-3.13
3687+ # 3.12-3.14
36883688 def _is_unionable (obj ):
36893689 """Corresponds to is_unionable() in unionobject.c in CPython."""
36903690 return obj is None or isinstance (obj , (
@@ -3797,7 +3797,7 @@ def __init__(self, name: str, value, *, type_params=()):
37973797 self .__name__ = name
37983798
37993799 def __setattr__ (self , name : str , value : object , / ) -> None :
3800- if hasattr (self , "__name__" ):
3800+ if hasattr (self , "__name__" ) and name != "__module__" :
38013801 self ._raise_attribute_error (name )
38023802 super ().__setattr__ (name , value )
38033803
@@ -3808,7 +3808,7 @@ def _raise_attribute_error(self, name: str) -> Never:
38083808 # Match the Python 3.12 error messages exactly
38093809 if name == "__name__" :
38103810 raise AttributeError ("readonly attribute" )
3811- elif name in {"__value__" , "__type_params__" , "__parameters__" , "__module__" }:
3811+ elif name in {"__value__" , "__type_params__" , "__parameters__" }:
38123812 raise AttributeError (
38133813 f"attribute '{ name } ' of 'typing.TypeAliasType' objects "
38143814 "is not writable"
0 commit comments