summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/_collections.py
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2012-11-17 15:28:50 -0500
committerDiana Clarke <diana.joan.clarke@gmail.com>2012-11-17 15:28:50 -0500
commit40071dbda4c2467f10a1ef217ce1d6e64058fba3 (patch)
tree02126593dc602dff8617b8b78846d4d6ce1a6d32 /lib/sqlalchemy/util/_collections.py
parentdbdd0fdd48bc0baf13a614fd193ad4fd6f697840 (diff)
downloadsqlalchemy-40071dbda4c2467f10a1ef217ce1d6e64058fba3.tar.gz
initializing _labels to an empty list so that the other methods don't throw exceptions in the None labels case, but rather return (), [], or {}. this is not backwards compatible, but doubt anyone is relying on those exceptions #2601
Diffstat (limited to 'lib/sqlalchemy/util/_collections.py')
-rw-r--r--lib/sqlalchemy/util/_collections.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py
index cefbb6d7f..0ed13f0d5 100644
--- a/lib/sqlalchemy/util/_collections.py
+++ b/lib/sqlalchemy/util/_collections.py
@@ -33,6 +33,7 @@ class KeyedTuple(tuple):
def __new__(cls, vals, labels=None):
t = tuple.__new__(cls, vals)
+ t._labels = []
if labels:
t.__dict__.update(zip(labels, vals))
t._labels = labels