From 7dabb2ec2f8941ba586f6addf6b681e548fa6af7 Mon Sep 17 00:00:00 2001
From: Konstantin Shulgin <konstantin.shulgin@gmail.com>
Date: Wed, 13 Jul 2011 16:50:13 +0400
Subject: [PATCH] refactoring-python-preprocessor: review fixes

- token_is_identifier function was changed;
- TarantoolStreamReader was updated;
- admin connection in tarantool console client wax fixed.
---
 test/lib/tarantool_preprocessor.py | 7 ++-----
 test/tarantool                     | 8 ++++----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/test/lib/tarantool_preprocessor.py b/test/lib/tarantool_preprocessor.py
index 6a587ed72f..365bb0eb03 100644
--- a/test/lib/tarantool_preprocessor.py
+++ b/test/lib/tarantool_preprocessor.py
@@ -106,10 +106,7 @@ def token_is_operator(token):
 
 
 def token_is_identifier(token):
-    token_type = token[0]
-    if token_type == tokenize.NAME:
-        return True
-    return False
+    return token[0] == tokenize.NAME
 
 
 def token_is_separator(token):
@@ -125,7 +122,7 @@ class TarantoolStreamReader(utf_8.StreamReader):
         try:
             data = tokenize.untokenize(tarantool_translate(self.stream.readline))
             self.stream = cStringIO.StringIO(data)
-        except Exception, e :
+        except Exception:
             self.stream.seek(0)
 
 
diff --git a/test/tarantool b/test/tarantool
index 8e4f72a9eb..053f08d3e9 100755
--- a/test/tarantool
+++ b/test/tarantool
@@ -69,7 +69,7 @@ class Options:
         default = "tarantool> ",
         help = """Command prompt. Set to "" for no prompt. Default:
         tarantool> """)
-    
+
     self.args = parser.parse_args()
 
 def init_readline_history():
@@ -84,12 +84,12 @@ def init_readline_history():
 
 
 def do_command(admin_con, data_con, line):
-  output = None 
+  output = None
   if is_admin_re.match(line):
-    output = admin_con.execute(line + "\n")
+    output = admin_con.execute(line)
   else:
     output = data_con.execute(line)
-  return output 
+  return output
 
 def main():
   init_readline_history()
-- 
GitLab