File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -255,11 +255,13 @@ def format(
255255 loaded_locale : Locale = Locale .load (locale or pendulum .get_locale ())
256256
257257 result = self ._FORMAT_RE .sub (
258- lambda m : m .group (1 )
259- if m .group (1 )
260- else m .group (2 )
261- if m .group (2 )
262- else self ._format_token (dt , m .group (3 ), loaded_locale ),
258+ lambda m : (
259+ m .group (1 )
260+ if m .group (1 )
261+ else m .group (2 )
262+ if m .group (2 )
263+ else self ._format_token (dt , m .group (3 ), loaded_locale )
264+ ),
263265 fmt ,
264266 )
265267
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ def parse_date(text: str, **options: t.Any) -> Date:
154154
155155 :param text: The string to parse.
156156 """
157- parsed = parse (text , exact = True , ** options )
157+ parsed = parse (text , exact = True , ** options )
158158 if not isinstance (parsed , Date ):
159159 if isinstance (parsed , DateTime ):
160160 return parsed .date ()
@@ -168,7 +168,7 @@ def parse_time(text: str, **options: t.Any) -> Time:
168168
169169 :param text: The string to parse.
170170 """
171- parsed = parse (text , exact = True , ** options )
171+ parsed = parse (text , exact = True , ** options )
172172 if not isinstance (parsed , Time ):
173173 if isinstance (parsed , DateTime ):
174174 return parsed .time ()
You can’t perform that action at this time.
0 commit comments