diff options
| author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-05-28 23:31:48 -0700 |
|---|---|---|
| committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-05-29 11:34:34 -0700 |
| commit | ce1374796a6dca53f44f1bd3fe09c6aa17574652 (patch) | |
| tree | 35503520a0c21cc10f9ae5c51c53b7fe1d303017 /sqlparse | |
| parent | 099435cff2c79f1455e532e1e5423332d01f3519 (diff) | |
| download | sqlparse-ce1374796a6dca53f44f1bd3fe09c6aa17574652.tar.gz | |
Remove encoding guessing on lexer.py
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/lexer.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index ca76eb1..a371af7 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -43,17 +43,7 @@ class Lexer(object): self._tokens[state].append((rex, tdef[1], new_state)) def _decode(self, text): - if sys.version_info[0] == 3: - if isinstance(text, str): - return text - if self.encoding == 'guess': - try: - text = text.decode('utf-8') - if text.startswith(u'\ufeff'): - text = text[len(u'\ufeff'):] - except UnicodeDecodeError: - text = text.decode('latin1') - else: + if not isinstance(text, text_type): try: text = text.decode(self.encoding) except UnicodeDecodeError: |
