diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-10 18:35:41 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-11 20:26:58 -0800 |
commit | 8ad2098b74ee90f341e69937a1503e29decf4594 (patch) | |
tree | ca6bb581c11fcb1a4cbe56b24aa9b83662293f3a /scripts/make_errorcodes.py | |
parent | f35465231f76039fae8677d48beacbdd2479095a (diff) | |
download | psycopg2-8ad2098b74ee90f341e69937a1503e29decf4594.tar.gz |
Drop 2to3 build step; make all code compatible with all Pythons
Make all library code compatible with both Python 2 and Python 3. Helps
move to modern Python idioms. Can now write for Python 3 (with
workarounds for Python 2) instead of the other way around.
In the future, when it is eventually time to drop Python 2, the library
will be in a better position to remove workarounds
Added a very small comparability module compat.py where required. It
includes definitions for:
- text_type -- A type. str on Python 3. unicode on Python 2.
- string_types -- A tuple. Contains only str on Python 3. Contains str &
unicode on Python 2.
Diffstat (limited to 'scripts/make_errorcodes.py')
-rwxr-xr-x | scripts/make_errorcodes.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index adc6ee8..aa5e4cd 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -159,7 +159,7 @@ def fetch_errors(versions): # https://github.com/postgres/postgres/commit/28e0727076 errors['55']['55P04'] = 'UNSAFE_NEW_ENUM_VALUE_USAGE' - for c, cerrs in e1.iteritems(): + for c, cerrs in e1.items(): errors[c].update(cerrs) return classes, errors |