Bug 21

Summary: MSYS detection fails if MSYS was not installed via installer
Product: pygame Reporter: Paul "TBBle" Hampson <Paul.Hampson>
Component: packagingAssignee: Thorbrian <brian>
Status: RESOLVED FIXED    
Severity: minor CC: len-l
Priority: P5    
Version: 1.8   
Hardware: PC   
OS: Windows   
Attachments: Patch to fix MSYS detection when MSYS was not installed by the installer

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