File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed
Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ translations = {{}}
192192 for k , v in d .items ():
193193 v = (
194194 self .format_dict (v , tab + 1 )
195- if isinstance (v , dict | LocaleDataDict )
195+ if isinstance (v , ( dict , LocaleDataDict ) )
196196 else repr (v )
197197 )
198198
Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ def _safe_timezone(
9191 Creates a timezone instance
9292 from a string, Timezone, TimezoneInfo or integer offset.
9393 """
94- if isinstance (obj , Timezone | FixedTimezone ):
94+ if isinstance (obj , ( Timezone , FixedTimezone ) ):
9595 return obj
9696
9797 if obj is None or obj == "local" :
9898 return local_timezone ()
9999
100- if isinstance (obj , int | float ):
100+ if isinstance (obj , ( int , float ) ):
101101 obj = int (obj * 60 * 60 )
102102 elif isinstance (obj , _datetime .tzinfo ):
103103 # zoneinfo
@@ -226,7 +226,7 @@ def instance(
226226 """
227227 Create a DateTime/Date/Time instance from a datetime/date/time native one.
228228 """
229- if isinstance (obj , DateTime | Date | Time ):
229+ if isinstance (obj , ( DateTime , Date , Time ) ):
230230 return obj
231231
232232 if isinstance (obj , _datetime .date ) and not isinstance (obj , _datetime .datetime ):
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ def offset_hours(self) -> float | None:
268268
269269 @property
270270 def timezone (self ) -> Timezone | FixedTimezone | None :
271- if not isinstance (self .tzinfo , Timezone | FixedTimezone ):
271+ if not isinstance (self .tzinfo , ( Timezone , FixedTimezone ) ):
272272 return None
273273
274274 return self .tzinfo
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ def __floordiv__(self, other: timedelta) -> int: ...
381381 def __floordiv__ (self , other : int ) -> Self : ...
382382
383383 def __floordiv__ (self , other : int | timedelta ) -> int | Duration :
384- if not isinstance (other , int | timedelta ):
384+ if not isinstance (other , ( int , timedelta ) ):
385385 return NotImplemented
386386
387387 usec = self ._to_microseconds ()
@@ -407,7 +407,7 @@ def __truediv__(self, other: timedelta) -> float: ...
407407 def __truediv__ (self , other : float ) -> Self : ...
408408
409409 def __truediv__ (self , other : int | float | timedelta ) -> Self | float :
410- if not isinstance (other , int | float | timedelta ):
410+ if not isinstance (other , ( int , float , timedelta ) ):
411411 return NotImplemented
412412
413413 usec = self ._to_microseconds ()
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def __sub__(self, other: time) -> pendulum.Duration: ...
174174 def __sub__ (self , other : datetime .timedelta ) -> Time : ...
175175
176176 def __sub__ (self , other : time | datetime .timedelta ) -> pendulum .Duration | Time :
177- if not isinstance (other , Time | time | timedelta ):
177+ if not isinstance (other , ( Time , time , timedelta ) ):
178178 return NotImplemented
179179
180180 if isinstance (other , timedelta ):
@@ -197,7 +197,7 @@ def __rsub__(self, other: time) -> pendulum.Duration: ...
197197 def __rsub__ (self , other : datetime .timedelta ) -> Time : ...
198198
199199 def __rsub__ (self , other : time | datetime .timedelta ) -> pendulum .Duration | Time :
200- if not isinstance (other , Time | time ):
200+ if not isinstance (other , ( Time , time ) ):
201201 return NotImplemented
202202
203203 if isinstance (other , time ):
You can’t perform that action at this time.
0 commit comments