From 4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 27 Apr 2013 19:53:57 -0400 Subject: - the raw 2to3 run - went through examples/ and cleaned out excess list() calls --- lib/sqlalchemy/sql/util.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 4aa2d7496..12edab3e1 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -232,7 +232,7 @@ def bind_values(clause): def _quote_ddl_expr(element): - if isinstance(element, basestring): + if isinstance(element, str): element = element.replace("'", "''") return "'%s'" % element else: @@ -349,7 +349,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False, continue try: col = fk.get_referent(left) - except exc.NoReferenceError, nrte: + except exc.NoReferenceError as nrte: if nrte.table_name == left.name: raise else: @@ -367,7 +367,7 @@ def join_condition(a, b, ignore_nonexistent_tables=False, continue try: col = fk.get_referent(b) - except exc.NoReferenceError, nrte: + except exc.NoReferenceError as nrte: if nrte.table_name == b.name: raise else: @@ -518,15 +518,15 @@ class AnnotatedColumnElement(Annotated): # so that the resulting objects are pickleable. annotated_classes = {} -for cls in expression.__dict__.values() + [schema.Column, schema.Table]: +for cls in list(expression.__dict__.values()) + [schema.Column, schema.Table]: if isinstance(cls, type) and issubclass(cls, expression.ClauseElement): if issubclass(cls, expression.ColumnElement): annotation_cls = "AnnotatedColumnElement" else: annotation_cls = "Annotated" - exec "class Annotated%s(%s, cls):\n" \ - " pass" % (cls.__name__, annotation_cls) in locals() - exec "annotated_classes[cls] = Annotated%s" % (cls.__name__,) + exec("class Annotated%s(%s, cls):\n" \ + " pass" % (cls.__name__, annotation_cls), locals()) + exec("annotated_classes[cls] = Annotated%s" % (cls.__name__,)) def _deep_annotate(element, annotations, exclude=None): @@ -765,7 +765,7 @@ class AliasedRow(object): return self.row[self.map[key]] def keys(self): - return self.row.keys() + return list(self.row.keys()) class ClauseAdapter(visitors.ReplacingCloningVisitor): -- cgit v1.2.1 From 62c7e0dbe64a3de27ad7631a11c813f929397c5e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 26 May 2013 13:10:00 -0400 Subject: sqlite tests --- lib/sqlalchemy/sql/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 12edab3e1..91740dc16 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -232,7 +232,7 @@ def bind_values(clause): def _quote_ddl_expr(element): - if isinstance(element, str): + if isinstance(element, util.string_types): element = element.replace("'", "''") return "'%s'" % element else: @@ -765,7 +765,7 @@ class AliasedRow(object): return self.row[self.map[key]] def keys(self): - return list(self.row.keys()) + return self.row.keys() class ClauseAdapter(visitors.ReplacingCloningVisitor): -- cgit v1.2.1