Commit ebafd536 authored by Dylan Trotter's avatar Dylan Trotter

Replace fake traceback module with real one from CPython.

parent cf431b57
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Print or retrieve a stack traceback."""
def print_exc(e):
print str(e)
......@@ -103,7 +103,7 @@ def _RunOneBenchmark(name, test_func):
except Exception as e: # pylint: disable=broad-except
result.status = 'error'
print 'ERROR'
traceback.print_exc(e)
traceback.print_exc()
else:
result.status = 'passed'
ops_per_sec = b.N / b.duration
......@@ -123,11 +123,11 @@ def _RunOneTest(name, test_func):
except AssertionError as e:
result.status = 'failed'
print name, 'FAILED'
traceback.print_exc(e)
traceback.print_exc()
except Exception as e: # pylint: disable=broad-except
result.status = 'error'
print name, 'ERROR'
traceback.print_exc(e)
traceback.print_exc()
else:
result.status = 'passed'
finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment