def _maybeFindSourceLine(testThing):
 method = getattr(testThing, '_testMethodName', None)
 if (method is not None):
  testThing = getattr(testThing, method)
 code = getattr(testThing, '__code__', None)
 if (code is not None):
  return code.co_firstlineno
 try:
  return inspect.getsourcelines(testThing)[1]
 except (IOError, TypeError):
  return (-1)

def _maybeFindSourceLine ( testThing ) : method = getattr ( testThing , '_testMethodName' , None ) if ( method is not None ) : testThing = getattr ( testThing , method ) code = getattr ( testThing , '__code__' , None ) if ( code is not None ) : return code . co_firstlineno try : return inspect . getsourcelines ( testThing ) [ 1 ] except ( IOError , TypeError ) : return ( - 1 )
try to find the source line of the given test thing .