tags 11679 fixed close 11679 27.1 quit Andreas Politz writes: > For list comprehensions pdb3 outputs a line like this. > >> FILE(LINE)() > > But the `listcomp' token is not captured by the `gud-pdb-marker-regexp', > resulting in pdb appearing to be hanging. (This may be python2/3 > related.) > > diff -c -L /usr/share/emacs/24.1.50/lisp/progmodes/gud.el.gz -L \#\ /tmp/jka-com19603ZkZ /tmp/buffer-content-19603z4l > *** /usr/share/emacs/24.1.50/lisp/progmodes/gud.el.gz > --- # > *************** > *** 1567,1573 **** > ;; Last group is for return value, e.g. "> test.py(2)foo()->None" > ;; Either file or function name may be omitted: "> (0)?()" > (defvar gud-pdb-marker-regexp > ! "^> \\([-a-zA-Z0-9_/.:\\]*\\|\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|\\)()\\(->[^\n\r]*\\)?[\n\r]") > > (defvar gud-pdb-marker-regexp-file-group 1) > (defvar gud-pdb-marker-regexp-line-group 2) > --- 1567,1573 ---- > ;; Last group is for return value, e.g. "> test.py(2)foo()->None" > ;; Either file or function name may be omitted: "> (0)?()" > (defvar gud-pdb-marker-regexp > ! "^> \\([-a-zA-Z0-9_/.:\\]*\\|\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<\\(?:module\\|listcomp\\)>\\)()\\(->[^\n\r]*\\)?[\n\r]") > > (defvar gud-pdb-marker-regexp-file-group 1) > (defvar gud-pdb-marker-regexp-line-group 2) > > Diff finished. Tue Jun 12 09:19:31 2012 I can reproduce this issue on current master, and it is indeed related to the new code object names for anonymous objects in Python 3. However, the fix you suggested was not complete, since it lacked support for other common code objects. I've therefore installed a slightly different patch on master (see attached). You could use the following Python 3 code to verify this fix: # lambda (lambda x: x + 1)(2) # setcomp -- set comprehension {s for s in [1, 2]} # dictcomp -- dict comprehension dict1 = {'a': 1, 'b': 2} dict1_cond = {k:v for (k,v) in dict1.items() if v>2} # listcomp -- list comprehension [x*x for x in range(0,2)] # genexpr -- generator expression (x for x in range(5)) tuple(range(5)) Save the above as e.g. foo.py and run: M-x pdb RET python3 -m pdb foo.py RET Then step through this to see output like this: > /Users/skangas/wip/emacs/lisp/foo.py(7)() [...] > /Users/skangas/wip/emacs/lisp/foo.py(11)() [etc.] AFAICT, the list I've installed is exhaustive, but if I've missed something I'm sure someone will report a new bug report. I'm therefore closing this bug report as fixed. Best regards, Stefan Kangas