Opened 8 years ago

#6603 enhancement new

Add a function to find the source line of an object when possible

Reported by: Julian Berman Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:


twisted.scripts.trial._maybeFindSourceLine and twisted.trial._synctest.SynchronousTestCase.flushWarnings both find the need to attempt to find the source lines where an object was defined when possible. They both make use of tools already present in the inspect standard library module, but do additional logic to address additional corner cases (e.g. finding line numbers when the source file no longer exists).

They should be refactored to use a common function for finding source lines that properly handles corner cases.

Change History (0)

Note: See TracTickets for help on using tickets.