Show More
@@ -34,6 +34,10 b' def flag_calls(func):' | |||||
34 | Testing for truth in wrapper.called allows you to determine if a call to |
|
34 | Testing for truth in wrapper.called allows you to determine if a call to | |
35 | func() was attempted and succeeded.""" |
|
35 | func() was attempted and succeeded.""" | |
36 |
|
36 | |||
|
37 | # don't wrap twice | |||
|
38 | if hasattr(func, 'called'): | |||
|
39 | return func | |||
|
40 | ||||
37 | def wrapper(*args,**kw): |
|
41 | def wrapper(*args,**kw): | |
38 | wrapper.called = False |
|
42 | wrapper.called = False | |
39 | out = func(*args,**kw) |
|
43 | out = func(*args,**kw) |
General Comments 0
You need to be logged in to leave comments.
Login now