@@ -696,8 +696,7 @@ def __new__(cls, days=0, seconds=0, microseconds=0,
696696 if abs (d ) > 999999999 :
697697 raise OverflowError ("timedelta # of days is too large: %d" % d )
698698
699- # GraalPy change: unsafe ctor to allow native subclasses
700- self = __graalpython__ .unsafe_object_new (cls )
699+ self = object .__new__ (cls )
701700 self ._days = d
702701 self ._seconds = s
703702 self ._microseconds = us
@@ -954,14 +953,12 @@ def __new__(cls, year, month=None, day=None):
954953 "Failed to encode latin1 string when unpickling "
955954 "a date object. "
956955 "pickle.load(data, encoding='latin1') is assumed." )
957- # GraalPy change: unsafe ctor to allow native subclasses
958- self = __graalpython__ .unsafe_object_new (cls )
956+ self = object .__new__ (cls )
959957 self .__setstate (year )
960958 self ._hashcode = - 1
961959 return self
962960 year , month , day = _check_date_fields (year , month , day )
963- # GraalPy change: unsafe ctor to allow native subclasses
964- self = __graalpython__ .unsafe_object_new (cls )
961+ self = object .__new__ (cls )
965962 self ._year = year
966963 self ._month = month
967964 self ._day = day
@@ -1373,16 +1370,14 @@ def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold
13731370 "Failed to encode latin1 string when unpickling "
13741371 "a time object. "
13751372 "pickle.load(data, encoding='latin1') is assumed." )
1376- # GraalPy change: unsafe ctor to allow native subclasses
1377- self = __graalpython__ .unsafe_object_new (cls )
1373+ self = object .__new__ (cls )
13781374 self .__setstate (hour , minute or None )
13791375 self ._hashcode = - 1
13801376 return self
13811377 hour , minute , second , microsecond , fold = _check_time_fields (
13821378 hour , minute , second , microsecond , fold )
13831379 _check_tzinfo_arg (tzinfo )
1384- # GraalPy change: unsafe ctor to allow native subclasses
1385- self = __graalpython__ .unsafe_object_new (cls )
1380+ self = object .__new__ (cls )
13861381 self ._hour = hour
13871382 self ._minute = minute
13881383 self ._second = second
@@ -1703,17 +1698,15 @@ def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
17031698 "Failed to encode latin1 string when unpickling "
17041699 "a datetime object. "
17051700 "pickle.load(data, encoding='latin1') is assumed." )
1706- # GraalPy change: unsafe ctor to allow native subclasses
1707- self = __graalpython__ .unsafe_object_new (cls )
1701+ self = object .__new__ (cls )
17081702 self .__setstate (year , month )
17091703 self ._hashcode = - 1
17101704 return self
17111705 year , month , day = _check_date_fields (year , month , day )
17121706 hour , minute , second , microsecond , fold = _check_time_fields (
17131707 hour , minute , second , microsecond , fold )
17141708 _check_tzinfo_arg (tzinfo )
1715- # GraalPy change: unsafe ctor to allow native subclasses
1716- self = __graalpython__ .unsafe_object_new (cls )
1709+ self = object .__new__ (cls )
17171710 self ._year = year
17181711 self ._month = month
17191712 self ._day = day
0 commit comments