import os
import sys
-from sqlparse.compat import text_type
from sqlconvert.print_tokens import print_tokens
from sqlconvert.process_mysql import is_directive_statement, process_statement
from sqlconvert.process_tokens import is_newline_statement, StatementGrouper
from m_lib.defenc import default_encoding
from m_lib.pbar.tty_pbar import ttyProgressBar
+try:
+ text_type = unicode
+except NameError:
+ text_type = str
+
def get_fsize(fp):
try:
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"""
token.normalized = token.value = value
-if PY3:
- xrange = range
-
-
class StatementGrouper(object):
"""Collect lines and reparse until the last statement is complete"""