[Patches] [ python-Patches-446899 ] Permit import of .pyw under Windows
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 01 Aug 2001 12:02:12 -0700
Patches item #446899, was opened at 2001-08-01 12:02
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=446899&group_id=5470
Category: core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David Bolen (db3l)
Assigned to: Nobody/Anonymous (nobody)
Summary: Permit import of .pyw under Windows
Initial Comment:
Under windows, the extension .pyw is provided (in the
default installation registry settings) to map scripts
to pythonw.exe (no console) rather than python.exe.
While scripts thus named are generally top level
scripts, in some cases even top level scripts are
imported by other code (particularly with test
harnesses). However, Python itself does not recognize
the pyw extension for import purposes. While an
explicit compilation of the pyw file can work around
this, it is error prone and manual - and subject to
failure if multiple Python releases are in use.
This patch adds .pyw as a possible source extension,
on Windows only. (With slight modification, it could
permit the extension on any platform if desired).
The .pyw extension is secondary in the table to .py,
so should both extensions exist (which is not a
logical thing to do, but someone could do it), the
import will find the .py prior to the .pyw.
The attached patch is against the CVS tree main branch
as of 8/1.
-- David
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=446899&group_id=5470