"platforms/opencl/tests/TestOpenCLSettle.cpp" did not exist on "64493da66474b3874c798d21d81b23fd5560134c"
Commit c55636e2 authored by John Chodera (MSKCC)'s avatar John Chodera (MSKCC)
Browse files

Refine error message on reading file.

parent 7b767ce4
......@@ -145,11 +145,11 @@ class ForceField(object):
# TODO: Also handle case where fallback to 'data' directory encounters problems,
# but this is much less worrisome because we control those files.
msg = str(e) + '\n'
if hasattr(file, 'close'):
if hasattr(file, 'name'):
filename = file.name
else:
filename = file
msg += 'ForceField.loadFile() encountered an error reading file: %s' % filename
filename = str(file)
msg += "ForceField.loadFile() encountered an error reading file '%s'\n" % filename
raise Exception(msg)
root = tree.getroot()
......
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