get_tables was failing with python3, because readline() returns bytes, which is always distinct to '', but then it failed with IndexError for empty lines. Also, line[0] was returning 42 instead of '*', so no table would be returned. I have tested with python2 too, and decode() can be called there, it will return unicode type, and comparing with '' and '*' workspull/20/head
try: | try: | ||||
tables_list = Popen(cmd, shell=True, stdout=PIPE) | tables_list = Popen(cmd, shell=True, stdout=PIPE) | ||||
while True: | while True: | ||||
line = tables_list.stdout.readline() | |||||
line = tables_list.stdout.readline().decode() | |||||
if line != '': | if line != '': | ||||
if line[0] == "*": | if line[0] == "*": | ||||
tables.append(line.rstrip()[1:]) | tables.append(line.rstrip()[1:]) |