@@ -1113,39 +1113,39 @@ def test_sys_getattr(self):
11131113 # CRASHES sys_getattr(NULL)
11141114
11151115 def test_sys_getattrstring (self ):
1116- sys_getattr = _testcapi .sys_getattrstring
1116+ getattrstring = _testcapi .sys_getattrstring
11171117
1118- self .assertIs (sys_getattr (b'stdout' ), sys .stdout )
1118+ self .assertIs (getattrstring (b'stdout' ), sys .stdout )
11191119 with support .swap_attr (sys , '\U0001f40d ' , 42 ):
1120- self .assertEqual (sys_getattr ('\U0001f40d ' .encode ()), 42 )
1120+ self .assertEqual (getattrstring ('\U0001f40d ' .encode ()), 42 )
11211121
11221122 with self .assertRaisesRegex (RuntimeError , r'lost sys\.nonexisting' ):
1123- sys_getattr (b'nonexisting' )
1124- self .assertRaises (UnicodeDecodeError , sys_getattr , b'\xff ' )
1125- # CRASHES sys_getattr (NULL)
1123+ getattrstring (b'nonexisting' )
1124+ self .assertRaises (UnicodeDecodeError , getattrstring , b'\xff ' )
1125+ # CRASHES getattrstring (NULL)
11261126
11271127 def test_sys_getoptionalattr (self ):
1128- sys_getattr = _testcapi .sys_getoptionalattr
1128+ getoptionalattr = _testcapi .sys_getoptionalattr
11291129
1130- self .assertIs (sys_getattr ('stdout' ), sys .stdout )
1130+ self .assertIs (getoptionalattr ('stdout' ), sys .stdout )
11311131 with support .swap_attr (sys , '\U0001f40d ' , 42 ):
1132- self .assertEqual (sys_getattr ('\U0001f40d ' ), 42 )
1132+ self .assertEqual (getoptionalattr ('\U0001f40d ' ), 42 )
11331133
1134- self .assertIs (sys_getattr ('nonexisting' ), AttributeError )
1135- self .assertIs (sys_getattr (1 ), AttributeError )
1136- self .assertRaises (TypeError , sys_getattr , [])
1137- # CRASHES sys_getattr (NULL)
1134+ self .assertIs (getoptionalattr ('nonexisting' ), AttributeError )
1135+ self .assertIs (getoptionalattr (1 ), AttributeError )
1136+ self .assertRaises (TypeError , getoptionalattr , [])
1137+ # CRASHES getoptionalattr (NULL)
11381138
11391139 def test_sys_getoptionalattrstring (self ):
1140- sys_getattr = _testcapi .sys_getoptionalattrstring
1140+ getoptionalattrstring = _testcapi .sys_getoptionalattrstring
11411141
1142- self .assertIs (sys_getattr (b'stdout' ), sys .stdout )
1142+ self .assertIs (getoptionalattrstring (b'stdout' ), sys .stdout )
11431143 with support .swap_attr (sys , '\U0001f40d ' , 42 ):
1144- self .assertEqual (sys_getattr ('\U0001f40d ' .encode ()), 42 )
1144+ self .assertEqual (getoptionalattrstring ('\U0001f40d ' .encode ()), 42 )
11451145
1146- self .assertIs (sys_getattr (b'nonexisting' ), AttributeError )
1147- self .assertRaises (UnicodeDecodeError , sys_getattr , b'\xff ' )
1148- # CRASHES sys_getattr (NULL)
1146+ self .assertIs (getoptionalattrstring (b'nonexisting' ), AttributeError )
1147+ self .assertRaises (UnicodeDecodeError , getoptionalattrstring , b'\xff ' )
1148+ # CRASHES getoptionalattrstring (NULL)
11491149
11501150 def test_sys_getobject (self ):
11511151 getobject = _testcapi .sys_getobject
0 commit comments