X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=sqlconvert%2Fprocess_tokens.py;h=886f36d46c02d1f824486593f3263bd06b3cb3b3;hb=HEAD;hp=414c5ca5a024bd783205655526897e87aa872ddf;hpb=2c347af7a3bdfb0e23ba96b28150d4e83485cf74;p=sqlconvert.git diff --git a/sqlconvert/process_tokens.py b/sqlconvert/process_tokens.py index 414c5ca..886f36d 100644 --- a/sqlconvert/process_tokens.py +++ b/sqlconvert/process_tokens.py @@ -2,9 +2,13 @@ from sqlparse.sql import Comment from sqlobject.converters import sqlrepr from sqlparse import parse -from sqlparse.compat import PY3 from sqlparse import tokens as T +try: + xrange +except NameError: + xrange = range + def find_error(token_list): """Find an error""" @@ -36,10 +40,6 @@ def escape_strings(token_list, dbname): token.normalized = token.value = value -if PY3: - xrange = range - - class StatementGrouper(object): """Collect lines and reparse until the last statement is complete"""