We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d09c085 + ca0e4bc commit a06f3b1Copy full SHA for a06f3b1
commitizen/cli.py
@@ -286,8 +286,13 @@ def main():
286
# This is for the command required constraint in 2.0
287
try:
288
args = parser.parse_args()
289
- except TypeError:
290
- raise NoCommandFoundError()
+ except (TypeError, SystemExit) as e:
+ # https://github.com/commitizen-tools/commitizen/issues/429
291
+ # argparse raises TypeError when non exist command is provided on Python < 3.9
292
+ # but raise SystemExit with exit code == 2 on Python 3.9
293
+ if isinstance(e, TypeError) or (isinstance(e, SystemExit) and e.code == 2):
294
+ raise NoCommandFoundError()
295
+ raise e
296
297
if args.name:
298
conf.update({"name": args.name})
0 commit comments