I can get error message printed out how to get the line number at which exceptoin occurred:
i am calling another python module from main module as follows, but exception prints out the main module's file and line no. I need to get the called module's file name occurrence and line no how do i do that?
try: stat = callablePy(mainArgv, instGlobalConfig) except Exception as errMsg: printErr("Exception occurred. ") printErr(str(errMsg)) printErr(str(errMsg.__class__)) stat = RET_EXCEPT
i am calling another python module from main module as follows, but exception prints out the main module's file and line no. I need to get the called module's file name occurrence and line no how do i do that?
print "importing " + file1 module = __import__(file1) try: callable = getattr(module, "main") res = callable( [str(file1), "asd"] ) except Exception as errMsg: print "exception!:" print errMsg print errMsg.__class__ obj1 = sys.exc_info() print obj1[2].tb_lineno print dir(obj1)