From 7bf1b0e53d69446918f1a4f70b856d72ec8848cb Mon Sep 17 00:00:00 2001 From: Andrea Gavana Date: Sat, 7 Apr 2012 21:07:41 +0000 Subject: [PATCH] Small modification to `modulehunter.py` to correctly pick up the latest wxPython version if Phoenix binaries are not available. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- sphinxtools/modulehunter.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sphinxtools/modulehunter.py b/sphinxtools/modulehunter.py index bbaf01e7..036e38fa 100644 --- a/sphinxtools/modulehunter.py +++ b/sphinxtools/modulehunter.py @@ -33,16 +33,21 @@ sys.setdefaultencoding("utf-8") try: import wx except ImportError: - wxPath = None + + wxPath = '' + basePath = '' + for path in sys.path: if 'wx-' in path: - wxPath = path - break + dummy, newPath = os.path.split(path) + if newPath > wxPath: + wxPath = newPath + basePath = dummy - if wxPath is None: + if not wxPath: raise Exception('Unable to find the wx package') - sys.path.insert(0, wxPath) + sys.path.insert(0, os.path.join(basePath, wxPath)) import wx