Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58387 > unrolled thread

Re: Debugging decorator

Started byJason Friedman <jsf80238@gmail.com>
First post2013-11-03 03:55 -0700
Last post2013-11-03 03:55 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Debugging decorator Jason Friedman <jsf80238@gmail.com> - 2013-11-03 03:55 -0700

#58387 — Re: Debugging decorator

FromJason Friedman <jsf80238@gmail.com>
Date2013-11-03 03:55 -0700
SubjectRe: Debugging decorator
Message-ID<mailman.1977.1383476116.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

> I wrote this decorator: https://gist.github.com/yasar11732/7163528
>
> I ran it with Python 2 and thought it was neat.
Most of my work is Python 3.
I ran 2to3-3.3 against it and I am getting this error:

$ ./simple.py
Traceback (most recent call last):
  File "./simple.py", line 3, in <module>
    @debugger.debugging
  File "/home/jason/python/debugger.py", line 41, in debugging
    new_function_body.append(make_print_node("function %s called" %
func.__name__))
  File "/home/jason/python/debugger.py", line 6, in make_print_node
    return ast.Print(dest=None, values=[ast.Str(s=s)], nl=True)
AttributeError: 'module' object has no attribute 'Print'

Comparing http://docs.python.org/2/library/ast.html#module-ast against
http://docs.python.org/3.3/library/ast.html#module-ast I see that "Print"
has indeed been removed.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web