From ac3d6e312aeea0253dfed9f333e2f584f7317649 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Thu, 29 Sep 2011 11:57:50 +0200 Subject: Remove some obsolete parts from lexer.py. --- sqlparse/lexer.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index e90cd64..456c7f4 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -231,15 +231,6 @@ class Lexer(object): text = text[len(u'\ufeff'):] except UnicodeDecodeError: text = text.decode('latin1') - elif self.encoding == 'chardet': - try: - import chardet - except ImportError: - raise ImportError('To enable chardet encoding guessing, ' - 'please install the chardet library ' - 'from http://chardet.feedparser.org/') - enc = chardet.detect(text) - text = text.decode(enc['encoding']) else: text = text.decode(self.encoding) if self.stripall: @@ -266,7 +257,7 @@ class Lexer(object): ``stack`` is the inital stack (default: ``['root']``) """ pos = 0 - tokendefs = self._tokens + tokendefs = self._tokens # see __call__, pylint:disable=E1101 statestack = list(stack) statetokens = tokendefs[statestack[-1]] known_names = {} -- cgit v1.2.1