From 2aa0d73972b4371693f1685cd6b5e006618bc445 Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Tue, 21 Jul 2026 18:44:30 -0400 Subject: [PATCH] fix: replace 4 bare except clauses with except Exception in jsdate.py Updated exception handling to specify Exception type. --- js2py/constructors/jsdate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js2py/constructors/jsdate.py b/js2py/constructors/jsdate.py index b6b70a81..4e1240b9 100644 --- a/js2py/constructors/jsdate.py +++ b/js2py/constructors/jsdate.py @@ -87,13 +87,13 @@ def local_strftime(self, pattern): return 'Invalid Date' try: dt = self.to_local_dt() - except: + except Exception: raise MakeError( 'TypeError', 'unsupported date range. Will fix in future versions') try: return dt.strftime(pattern) - except: + except Exception: raise MakeError( 'TypeError', 'Could not generate date string from this date (limitations of python.datetime)' @@ -104,13 +104,13 @@ def utc_strftime(self, pattern): return 'Invalid Date' try: dt = self.to_utc_dt() - except: + except Exception: raise MakeError( 'TypeError', 'unsupported date range. Will fix in future versions') try: return dt.strftime(pattern) - except: + except Exception: raise MakeError( 'TypeError', 'Could not generate date string from this date (limitations of python.datetime)'