diff options
Diffstat (limited to 'test/farm')
| -rw-r--r-- | test/farm/run/src/chdir.py | 4 | ||||
| -rw-r--r-- | test/farm/run/src/showtrace.py | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/test/farm/run/src/chdir.py b/test/farm/run/src/chdir.py index 23c5afa8..d8287ed7 100644 --- a/test/farm/run/src/chdir.py +++ b/test/farm/run/src/chdir.py @@ -1,5 +1,5 @@ import os -print "Line One" +print("Line One") os.chdir("subdir") -print "Line Two" +print("Line Two") diff --git a/test/farm/run/src/showtrace.py b/test/farm/run/src/showtrace.py index 3708ac08..c3b4356c 100644 --- a/test/farm/run/src/showtrace.py +++ b/test/farm/run/src/showtrace.py @@ -3,13 +3,16 @@ import sys -# Print the argument as a label for the output. -print sys.argv[1], - # Show what the trace function is. If a C-based function is used, then f_trace # is None. trace_fn = sys._getframe(0).f_trace if trace_fn is None: - print "None" + trace_name = "None" else: - print trace_fn.im_class.__name__ + # Get the name of the tracer class. Py3k has a different way to get it. + try: + trace_name = trace_fn.im_class.__name__ + except AttributeError: + trace_name = trace_fn.__self__.__class__.__name__ + +print("%s %s" % (sys.argv[1], trace_name)) |
