On Jan 31, 2010, at 12:36 PM, Georg Brandl wrote: >Not really -- much of the code I've seen that tries to guess the source >file name from a __file__ value just does something like this: > > if fname.lower().endswith(('.pyc', '.pyo')): fname = fname[:-1] > >That's not compatible with using .pyr, either.
The rationale for the .pyr extension is because I've usually seen (and written) this instead: base, ext = os.path.splitext(fname) py_file = base + '.py' # ...or... if ext != '.py': continue I think I rarely care what the extension is if it's not '.py'. -Barry
signature.asc
Description: PGP signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com