summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <zilch@src.gnome.org>2003-01-08 20:15:18 +0000
committerJohan Dahlin <zilch@src.gnome.org>2003-01-08 20:15:18 +0000
commite1c97a036335188d788cad5c3fe2dc8bd41f09ff (patch)
tree7541ee3f495bd45104a0562634723f1370efca4b
parent91a638791a09285e052415194c3a35f9ce231bdc (diff)
downloadpygobject-e1c97a036335188d788cad5c3fe2dc8bd41f09ff.tar.gz
Doh! Paper bag
-rw-r--r--pygtk.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pygtk.py b/pygtk.py
index 77c68621..8f3dcd51 100644
--- a/pygtk.py
+++ b/pygtk.py
@@ -26,6 +26,8 @@ import sys
__all__ = ['require']
+_pygtk_dir_pat = 'gtk-[0-9].[0-9]'
+
_pygtk_required_version = None
def _get_available_versions():
@@ -36,10 +38,10 @@ def _get_available_versions():
if not os.path.isdir(dir):
continue
- if fnmatch.fnmatchcase(os.path.basename(dir), DIR_PAT):
+ if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
continue # if the dir is a pygtk dir, skip it
- for filename in glob.glob(os.path.join(dir, DIR_PAT)):
+ for filename in glob.glob(os.path.join(dir, _pygtk_dir_pat)):
pathname = os.path.join(dir, filename)
if not os.path.isdir(pathname):
continue # skip non directories
@@ -65,7 +67,7 @@ def require(version):
# remove any pygtk dirs first ...
for dir in sys.path:
- if _pygtk_dir_pat.match(os.path.basename(dir)):
+ if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
sys.path.remove(dir)
# prepend the pygtk path ...