Make getsourcefile() succeed even if the filename doesn't end in '.py' --
as long as the filename also doesn't end in a suffix that indicates a binary file (according to the flags in imp.get_suffixes()). Shrink try...except clauses and replace some of them with explicit checks.
Showing
Please
register
or
sign in
to comment