summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r--sqlparse/sql.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index 8b530bd..50952bc 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -44,10 +44,8 @@ class Token(object):
def __repr__(self):
cls = self._get_repr_name()
value = self._get_repr_value()
- if value.startswith("'") and value.endswith("'"):
- q = '"'
- else:
- q = "'"
+
+ q = '"' if value.startswith("'") and value.endswith("'") else "'"
return "<{cls} {q}{value}{q} at 0x{id:2X}>".format(
id=id(self), **locals())
@@ -170,10 +168,8 @@ class TokenList(Token):
for idx, token in enumerate(self.tokens):
cls = token._get_repr_name()
value = token._get_repr_value()
- if value.startswith("'") and value.endswith("'"):
- q = '"'
- else:
- q = "'"
+
+ q = '"' if value.startswith("'") and value.endswith("'") else "'"
print("{indent}{idx:2d} {cls} {q}{value}{q}"
.format(**locals()), file=f)