Skip to content

Commit 252d59a

Browse files
committed
Updated dependencies
1 parent e9d8c5a commit 252d59a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ classifiers = [
3333
]
3434
dependencies = [
3535
"argcomplete>=3.0.8",
36-
"asciistuff>=1.3.1",
37-
"codext>=1.15.4",
36+
"asciistuff>=1.3.3",
37+
"codext>=1.15.7",
3838
"coloredlogs",
3939
"colorful",
4040
"dateparser>=1.1.8",
@@ -67,7 +67,7 @@ dependencies = [
6767
"toml",
6868
"tqdm",
6969
"virtualenv>=20.26.3",
70-
"weasyprint>=64.1",
70+
"weasyprint>=65.1",
7171
"xmltodict",
7272
]
7373
dynamic = ["version"]

src/tinyscript/argreparse.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -753,14 +753,17 @@ def parse_known_args(self, args=None, namespace=None):
753753
if not hasattr(namespace, dest):
754754
setattr(namespace, dest, self._defaults[dest])
755755
# parse the arguments and exit if there are any errors
756-
a = (args, namespace) if sys.version_info.minor < 13 else (args, namespace, False)
757-
if self.exit_on_error:
756+
for a in [(args, namespace), (args, namespace, False)]: # second tuple shall work with Python 3.13+
758757
try:
759-
namespace, args = self._parse_known_args(*a)
760-
except ArgumentError as err:
761-
self.error(str(err))
762-
else:
763-
namespace, args = self._parse_known_args(*a)
758+
if self.exit_on_error:
759+
try:
760+
namespace, args = self._parse_known_args(*a)
761+
except ArgumentError as err:
762+
self.error(str(err))
763+
else:
764+
namespace, args = self._parse_known_args(*a)
765+
except TypeError:
766+
continue
764767
if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
765768
args.extend(set(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)))
766769
try:

0 commit comments

Comments
 (0)