@@ -182,7 +182,7 @@ def _find_best_matching_date(cls, datestring):
182182 dt = strptime (datestring , fmt ), cls ._get_period (fmt )
183183 if len (str (dt [0 ].year )) == 4 :
184184 return dt
185- except :
185+ except Exception :
186186 pass
187187 return None
188188
@@ -216,7 +216,7 @@ def parse(cls, datestring, settings):
216216 missing = _get_missing_parts (fmt )
217217 _check_strict_parsing (missing , settings )
218218 return dt
219- except :
219+ except Exception :
220220 pass
221221 else :
222222 if ambiguous_date :
@@ -332,7 +332,7 @@ def __init__(self, tokens, settings):
332332 token .index (":" )
333333 # Is after period? raise ValueError if '.' can't be found:
334334 self .tokens [self .tokens .index ((token , 0 )) + 1 ][0 ].index ("." )
335- except :
335+ except Exception :
336336 microsecond = None
337337
338338 if microsecond :
@@ -342,7 +342,7 @@ def __init__(self, tokens, settings):
342342 meridian = MERIDIAN .search (
343343 self .filtered_tokens [meridian_index ][0 ]
344344 ).group ()
345- except :
345+ except Exception :
346346 meridian = None
347347
348348 if any ([":" in token , meridian , microsecond ]):
@@ -514,9 +514,9 @@ def _correct_for_time_frame(self, dateobj, tz):
514514
515515 # NOTE: If this assert fires, self.now needs to be made offset-aware in a similar
516516 # way that dateobj is temporarily made offset-aware.
517- assert not (
518- self .now . tzinfo is None and dateobj . tzinfo is not None
519- ), "`self.now` doesn't have `tzinfo`. Review comment in code for details."
517+ assert not (self . now . tzinfo is None and dateobj . tzinfo is not None ), (
518+ "` self.now` doesn't have ` tzinfo`. Review comment in code for details."
519+ )
520520
521521 # Store the original dateobj values so that upon subsequent parsing everything is not
522522 # treated as offset-aware if offset awareness is changed.
@@ -686,7 +686,7 @@ def parse_alpha(token, skip_component=None):
686686 (component , getattr (do , component )),
687687 ("day" , prev_value ),
688688 ]
689- except :
689+ except Exception :
690690 pass
691691 else :
692692 raise ValueError ("Unable to parse: %s" % token )
0 commit comments