| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,14 @@ News | |||
| 5 | 5 | .. contents:: Contents: | |
| 6 | 6 | :backlinks: none | |
| 7 | 7 | ||
| 8 | - SQLObject 3.8.0 (master) | ||
| 9 | - ======================== | ||
| 8 | + SQLObject (master) | ||
| 9 | + ================== | ||
| 10 | + | ||
| 11 | + Minor features | ||
| 12 | + -------------- | ||
| 13 | + | ||
| 14 | + * Adapt Postgres exception handling to ``psycopg2`` version ``2.8``: | ||
| 15 | + in the recent ``psycopg2`` errors are in ``psycopg2.errors`` module. | ||
| 10 | 16 | ||
| 11 | 17 | SQLObject 3.7.1 | |
| 12 | 18 | =============== | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | class ErrorMessage(str): | |
| 12 | 12 | def __new__(cls, e, append_msg=''): | |
| 13 | 13 | obj = str.__new__(cls, e.args[0] + append_msg) | |
| 14 | - if e.__module__ == 'psycopg2': | ||
| 14 | + if hasattr(e, 'pgcode'): # psycopg2 or psycopg2.errors | ||
| 15 | 15 | obj.code = getattr(e, 'pgcode', None) | |
| 16 | 16 | obj.error = getattr(e, 'pgerror', None) | |
| 17 | 17 | else: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments