+
+ global _selected
+ if _selected is not None:
+ # A version was previously selected, ensure that it matches
+ # this new request
+ for ver in versions:
+ if _selected.Score(_wxPackageInfo(ver)) > 0:
+ return
+ # otherwise, raise an exception
+ raise wxversionError("A previously selected wx version does not match the new request.")
+
+ # If we get here then this is the first time wxversion is used.
+ # Ensure that wxPython hasn't been imported yet.
+ if sys.modules.has_key('wx') or sys.modules.has_key('wxPython'):
+ raise wxversionError("wxversion.require() must be called before wxPython is imported")
+
+ # Look for a matching version and manipulate the sys.path as
+ # needed to allow it to be imported.