A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gitpython-developers/GitPython/issues/1924 below:

Can't catch GitCommandError · Issue #1924 · gitpython-developers/GitPython · GitHub

I am trying to do a cherry-pick, but abort when it fails:

import git
...
git = repo.git
try:
    git.cherry_pick(commit)
except git.GitCommandError as e:
    git.cherry_pick(abort=True)
...

but I get this:

    except git.GitCommandError as e:
   TypeError: catching classes that do not inherit from BaseException is not allowed

Now I can obviously do except Exception as e... But, I would like to be explicit to defer code-paths.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4