Commits

Victor Stinner committed 2f45cf9

gdb: fix follow command on Python3

  • Participants
  • Parent commits aa77a47

Comments (0)

Files changed (1)

 from ptrace.tools import inverseDict
 from ptrace.func_call import FunctionCallOptions
 from ptrace.signames import signalName, SIGNAMES
+from ptrace.six import PY3, binary_type
 from signal import SIGTRAP, SIGINT
 from ptrace.terminal import enableEchoMode, terminalWidth
 from errno import ESRCH
         # FIXME: Validate input
 #        if not BYTES_REGEX.match(text):
 #            raise ValueError('Follow text must be enclosed in quotes!')
+        if PY3:
+            text = 'b' + text.lstrip()
         value = eval(text)
-        if not isinstance(value, str):
+        if not isinstance(value, binary_type):
             raise TypeError("Input is not a bytes string!")
         return value
 
                     ok &= self.execute(command)
                 except Exception as err:
                     print("Command error: %s" % err)
+                    raise
                     ok = False
                 if not ok:
                     break