Closed grybmadsci closed 8 years ago
I only see this outside a virtualenv, haven't investigated the root cause yet, but at the very least this should be a warning a a fatal crash and burn.
Even the python stacktrace couldn't get the source code, and it looks like you might be doing something fancy with compiled python or a ZipImporter? I agree, we should wrap the getsource functions with a try-except. I can take this one if you haven't started it
I don't think we were doing anything fancy, just running on an ubuntu install, but outside a virtualenv.
Outside a virtualenv, meaning using the default system python?
Yep, default system python on Ubuntu.
Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "build/bdist.linux-x86_64/egg/tbtech/tests/metrology.py", line 78, in
File "/usr/local/lib/python2.7/dist-packages/openhtf/util/measurements.py", line 383, in decorate
phase = openhtf.PhaseInfo.WrapOrCopy(wrapped_phase)
File "/usr/local/lib/python2.7/dist-packages/openhtf/init.py", line 312, in WrapOrCopy
func = cls(func, test_record.CodeInfo.ForFunction(func))
File "/usr/local/lib/python2.7/dist-packages/openhtf/io/test_record.py", line 98, in ForFunction
source = inspect.getsource(func)
File "/usr/lib/python2.7/inspect.py", line 701, in getsource
lines, lnum = getsourcelines(object)
File "/usr/lib/python2.7/inspect.py", line 690, in getsourcelines
lines, lnum = findsource(object)
File "/usr/lib/python2.7/inspect.py", line 538, in findsource
raise IOError('could not get source code')
IOError: could not get source code