summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2020-03-28 11:04:44 +0100
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-28 13:23:12 -0400
commit5b6a1a98903830ac563f936ccbe1fe30d88ec77c (patch)
tree68a7bee4f772718aafdd0e1bd8bf0e2548d482d1 /lib/sqlalchemy
parentee1e1e2f5540a6e32986b1041db4dfd55894e68b (diff)
downloadsqlalchemy-5b6a1a98903830ac563f936ccbe1fe30d88ec77c.tar.gz
Fix typo in resultproxy.c and test compatibility with python 3.5
- Fix typo in resultproxy.c that would error on windows. - add -Wundef to C flags when linux is detected so that undefined symbols emit a warning - a few adjustments for tests to succeed on python 3.5 - note minimum version still documented here as 3.4 but this should move to at least 3.5 if not 3.6 for SQLAlchemy 1.4 Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/cextension/resultproxy.c4
-rw-r--r--lib/sqlalchemy/testing/util.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/cextension/resultproxy.c b/lib/sqlalchemy/cextension/resultproxy.c
index f622e6a28..b105038bc 100644
--- a/lib/sqlalchemy/cextension/resultproxy.c
+++ b/lib/sqlalchemy/cextension/resultproxy.c
@@ -21,7 +21,7 @@ typedef Py_ssize_t (*lenfunc)(PyObject *);
typedef intargfunc ssizeargfunc;
#endif
-#if PY_MAJOR_VERSON < 3
+#if PY_MAJOR_VERSION < 3
// new typedef in Python 3
typedef long Py_hash_t;
@@ -359,7 +359,7 @@ BaseRow_subscript_impl(BaseRow *self, PyObject *key, int asmapping)
/* -1 can be either the actual value, or an error flag. */
return NULL;
if (index < 0)
- index += BaseRow_length(self);
+ index += (long)BaseRow_length(self);
return BaseRow_getitem(self, index);
} else if (PySlice_Check(key)) {
values = PyObject_GetItem(self->row, key);
diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py
index c52dc4a19..586974f11 100644
--- a/lib/sqlalchemy/testing/util.py
+++ b/lib/sqlalchemy/testing/util.py
@@ -17,6 +17,7 @@ from ..util import defaultdict
from ..util import has_refcount_gc
from ..util import inspect_getfullargspec
from ..util import py2k
+from ..util import py36
if not has_refcount_gc:
@@ -53,7 +54,7 @@ def picklers():
yield pickle_.loads, lambda d: pickle_.dumps(d, protocol)
-if py2k:
+if py2k or not py36:
def random_choices(population, k=1):
pop = list(population)