summaryrefslogtreecommitdiff
path: root/pygtk.py
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
commit89083a7ab53881da21787ce43653ac1d61b434d0 (patch)
tree061e9f14da450c5e28c77cd64babde4eb7995d16 /pygtk.py
parent05898a98b6e813abbfa8db6e46bf1a8a8d71b4fb (diff)
downloadpygtk-89083a7ab53881da21787ce43653ac1d61b434d0.tar.gz
Doh! Paper bag
Diffstat (limited to 'pygtk.py')
-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 ...