diff options
author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-08-22 19:25:06 -0700 |
---|---|---|
committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-08-22 19:25:06 -0700 |
commit | ae0532678b0fdc859cae021ee135579d875a24a8 (patch) | |
tree | 01b9baa4e53363fc2327c737db168098bd87313e /sqlparse/sql.py | |
parent | 47dbacf650b287488d7e86238b74e3dee23af98f (diff) | |
download | sqlparse-ae0532678b0fdc859cae021ee135579d875a24a8.tar.gz |
Clean-up quoting
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r-- | sqlparse/sql.py | 12 |
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) |