← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-sqlrepr into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-sqlrepr into launchpad:master.

Commit message:
Fix sqlobject compatibility layer for Python 3 type changes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/391483
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-sqlrepr into launchpad:master.
diff --git a/lib/sqlobject/__init__.py b/lib/sqlobject/__init__.py
index 1e85316..19a8410 100644
--- a/lib/sqlobject/__init__.py
+++ b/lib/sqlobject/__init__.py
@@ -51,7 +51,7 @@ def sqlrepr(value, dbname=None):
             return "'f'"
     elif isinstance(value, int):
         return repr(int(value))
-    elif isinstance(value, long):
+    elif six.PY2 and isinstance(value, long):
         return str(value)
     elif isinstance(value, float):
         return repr(value)