changeset 8964:119d1f664eae

extensions: catch OSError when hgext is not accessible (issue1708) Temporary workaround for issue1708: on win32 with py2exe, hgext is distributed inside a zipped file (which anyway does not contain the py files from which we ought to extract the documentation strings), which raises a WindowsError (subclasses OSError). This means that on such platforms the list of disabled extensions won't be available. Real fix postponed for after Mercurial 1.3.
author Cédric Duval <cedricduval@free.fr>
date Mon, 29 Jun 2009 19:28:54 +0200
parents a4ceae3aa7be
children 09c6735e3880
files mercurial/extensions.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Wed May 06 16:27:50 2009 -0400
+++ b/mercurial/extensions.py	Mon Jun 29 19:28:54 2009 +0200
@@ -125,9 +125,14 @@
     import hgext
     extpath = os.path.dirname(os.path.abspath(hgext.__file__))
 
+    try: # might not be a filesystem path
+        files = os.listdir(extpath)
+    except OSError:
+        return None, 0
+
     exts = {}
     maxlength = 0
-    for e in os.listdir(extpath):
+    for e in files:
 
         if e.endswith('.py'):
             name = e.rsplit('.', 1)[0]