Skip to content

Instantly share code, notes, and snippets.

@IdlePhysicist
Created August 6, 2019 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IdlePhysicist/9dc911436e9e4ed489d8e3a25768af0a to your computer and use it in GitHub Desktop.
Save IdlePhysicist/9dc911436e9e4ed489d8e3a25768af0a to your computer and use it in GitHub Desktop.
Find out what exceptions are defined in a module.
# Where sqlite3 is the place holder for the module that you want to find the exceptions for.
import sqlite3, inspect
print( [name for name, value in vars(sqlite3).items() if inspect.isclass(value) and issubclass(value, Exception)] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment