Merge lp:~cjwatson/storm/psycopg-2.5 into lp:storm
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Björn Tillenius | ||||||||
Approved revision: | 478 | ||||||||
Merged at revision: | 478 | ||||||||
Proposed branch: | lp:~cjwatson/storm/psycopg-2.5 | ||||||||
Merge into: | lp:storm | ||||||||
Diff against target: |
29 lines (+9/-3) 1 file modified
storm/exceptions.py (+9/-3) |
||||||||
To merge this branch: | bzr merge lp:~cjwatson/storm/psycopg-2.5 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Björn Tillenius (community) | Approve | ||
Adam Collard (community) | Approve | ||
Review via email: mp+278330@code.launchpad.net |
Commit message
Use ABCMeta for exception base class injection
This requires Python >= 2.6 (which is unlikely to be a problem these days!),
and adds compatibility with psycopg2 >= 2.5.
Description of the change
Use ABCMeta for exception base class injection.
This lets us be compatible with psycopg2 >= 2.5, where Error and subclasses are implemented in a C extension so can't have their __bases__ attribute patched.
It does introduce a potential obstacle to porting to Python 3 due to a Python bug noted in a comment. Other possible approaches include converting StormError et al into tuples (but that would be an API break if anyone was using them for any purpose other than isinstance/
Looks good to me! +1