@@ -996,16 +996,7 @@ def __init__(self):
996996 super (two , self ).__init__ ()
997997 self .cnt += 1
998998
999- if is_cli :
1000- try :
1001- self .assertEqual (two ().cnt , 3 )
1002- except SystemError :
1003- # https://github.com/IronLanguages/ironpython3/issues/451
1004- pass
1005- else :
1006- self .fail ("delete the try/except when https://github.com/IronLanguages/ironpython3/issues/451 is fixed" )
1007- else :
1008- self .assertEqual (two ().cnt , 3 )
999+ self .assertEqual (two ().cnt , 3 )
10091000
10101001 def test_ipy2_gh292 (self ):
10111002 """https://github.com/IronLanguages/ironpython2/issues/292"""
@@ -1449,4 +1440,32 @@ def run(self):
14491440 self .assertEqual (thread .thread_executed , 1 )
14501441 test_thread ()
14511442
1443+ def test_ipy3_gh451 (self ):
1444+ """https://github.com/IronLanguages/ironpython3/issues/451"""
1445+ def test ():
1446+ class two (object ):
1447+ def __init__ (self ):
1448+ super ().__init__ ()
1449+ self .cnt = 1
1450+ return two ().cnt
1451+ self .assertEqual (test (), 1 )
1452+
1453+ class test__class__keyword (object ):
1454+ def __new__ (cls ):
1455+ return super ().__new__ (cls )
1456+ def __init__ (self ):
1457+ super ().__init__ ()
1458+ def get_self_class (self ):
1459+ return self .__class__
1460+ def get_class (self ):
1461+ return __class__
1462+ @classmethod
1463+ def get_class_class (cls ):
1464+ return cls
1465+
1466+ o = test__class__keyword ()
1467+ self .assertEqual (o .get_self_class (), o .get_class ())
1468+ self .assertEqual (o .get_class (), o .get_class_class ())
1469+
1470+
14521471run_test (__name__ )
0 commit comments