Bug 21 - MSYS detection fails if MSYS was not installed via installer
: MSYS detection fails if MSYS was not installed via installer
Status: RESOLVED FIXED
Product: pygame
packaging
: 1.8
: PC Windows
: P5 minor (vote)
Assigned To: Thorbrian
:
:
:
  Show dependency treegraph
 
Reported: 2008-08-31 06:23 PDT by Paul "TBBle" Hampson
Modified: 2008-08-31 20:45 PDT (History)
1 user (show)

See Also:


Attachments
Patch to fix MSYS detection when MSYS was not installed by the installer (793 bytes, patch)
2008-08-31 06:23 PDT, Paul "TBBle" Hampson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul "TBBle" Hampson 2008-08-31 06:23:39 PDT
Created attachment 12 [details]
Patch to fix MSYS detection when MSYS was not installed by the installer

The MSYS detection code in msys.py, specifically find_msys_registry(), attempts
to find the directory the MSYS installer's uninstall entry has recorded in the
Windows Registry, raising a LookupError exception if no result was found which
allows higher code to fall back to prompting the user.

However, the call to _winreg.OpenKey is outside the try/except block, so if the
key does not exist the wrong exception is thrown, and setup.py aborts without
ever offering the prompt.

The attached patch corrects this, by ensuring that the OpenKey is performed
inside the outer try block, and the outer try block raises a LookupError on an
exception. The inner try block is still necessary to ensure that the finally
clause is run if we successfully OpenKeyed.
Comment 1 Lenard Lindstrom 2008-08-31 20:45:18 PDT
Thanks for the report.

Fixed in SVN revision 1644