2

I have some code that is throwing this error when a read fails: object of type 'builtin_function_or_method' has no len()

and i want to find which line in the code is causing this. This is printed in an except statement:

except Exception, err:
    print "Unable to read data"
    print err
4

1 回答 1

2

使用traceback模块,您可以执行以下操作:

try:
    # your code here
except:
    import traceback
    traceback.print_exc()
于 2013-07-30T14:07:12.617 回答