@@ -923,7 +923,7 @@ def __new__(
923923 microsecond : int = 0 ,
924924 tzinfo : Optional [tzinfo ] = None ,
925925 * ,
926- fold : int = 0
926+ fold : int = 0 ,
927927 ) -> "time" :
928928 _check_time_fields (hour , minute , second , microsecond , fold )
929929 _check_tzinfo_arg (tzinfo )
@@ -994,6 +994,8 @@ def fromisoformat(cls, time_string: str) -> "time":
994994 Valid format is ``HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]``
995995
996996 """
997+ if time_string [- 1 ] == "Z" :
998+ time_string = f"{ time_string [:- 1 ]} +00:00"
997999 # Store the original string in an error message
9981000 original_string = time_string
9991001 match = _re .match (r"(.*)[\-\+]" , time_string )
@@ -1254,7 +1256,7 @@ def __new__(
12541256 microsecond : int = 0 ,
12551257 tzinfo : Optional [tzinfo ] = None ,
12561258 * ,
1257- fold : int = 0
1259+ fold : int = 0 ,
12581260 ) -> "datetime" :
12591261 _check_date_fields (year , month , day )
12601262 _check_time_fields (hour , minute , second , microsecond , fold )
@@ -1599,7 +1601,7 @@ def replace(
15991601 microsecond : Optional [str ] = None ,
16001602 tzinfo : bool = True ,
16011603 * ,
1602- fold : Optional [int ] = None
1604+ fold : Optional [int ] = None ,
16031605 ) -> "datetime" :
16041606 """Return a datetime with the same attributes,
16051607 except for those attributes given new values by
0 commit comments