Title: Can't catch GitCommandError · Issue #1924 · gitpython-developers/GitPython · GitHub
Open Graph Title: Can't catch GitCommandError · Issue #1924 · gitpython-developers/GitPython
X Title: Can't catch GitCommandError · Issue #1924 · gitpython-developers/GitPython
Description: 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: TypeEr...
Open Graph Description: 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:...
X Description: 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:...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1924
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't catch GitCommandError","articleBody":"I am trying to do a cherry-pick, but abort when it fails:\r\n\r\n```python\r\nimport git\r\n...\r\ngit = repo.git\r\ntry:\r\n git.cherry_pick(commit)\r\nexcept git.GitCommandError as e:\r\n git.cherry_pick(abort=True)\r\n...\r\n```\r\nbut I get this:\r\n```\r\n except git.GitCommandError as e:\r\n TypeError: catching classes that do not inherit from BaseException is not allowed\r\n```\r\nNow I can obviously do `except Exception as e`... But, I would like to be explicit to defer code-paths.","author":{"url":"https://github.com/zerothi","@type":"Person","name":"zerothi"},"datePublished":"2024-05-31T20:07:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/1924/GitPython/issues/1924"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3853fae9-af50-0066-154b-e7731acaea30 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D272:253CE6:1A676B6:24F5695:6968B47D |
| html-safe-nonce | 403f454bcd1e7bfb6d995a473d37265ee1f38196ff7456cbd74f394e8713713f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjcyOjI1M0NFNjoxQTY3NkI2OjI0RjU2OTU6Njk2OEI0N0QiLCJ2aXNpdG9yX2lkIjoiMjA1NDE2NzA2MjgzMjAwMjE3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e4c821c43985473f23ff30489f1b444a6869b10457623b9929fc096da63e6b4d |
| hovercard-subject-tag | issue:2328518153 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1924/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b4816bf850c7cbc02ac8376759e6ec9e11d153881c8bddb71f1ff3aaa493b975/gitpython-developers/GitPython/issues/1924 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b4816bf850c7cbc02ac8376759e6ec9e11d153881c8bddb71f1ff3aaa493b975/gitpython-developers/GitPython/issues/1924 |
| og:image:alt | 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:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zerothi |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3223a6503d318917691422cdadfbe16cd8fb21e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width