From ae0532678b0fdc859cae021ee135579d875a24a8 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Mon, 22 Aug 2016 19:25:06 -0700 Subject: Clean-up quoting --- sqlparse/sql.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sqlparse') 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) -- cgit v1.2.1