[PATCH 4 of 6] Use .has_option to avoid the unknown Exception

Ollivier Robert roberto at keltia.freenix.fr
Wed Aug 24 10:47:26 CDT 2005


Patch subject is complete summary.


# HG changeset patch
# User Ollivier Robert <roberto at keltia.freenix.fr>
# Node ID 05f2e370f11340ce10135b35cccf8180be8ecde0
# Parent  032e712313aeef0f275c3b196612905174c2d1cf
Use .has_option to avoid the unknown Exception.

diff -r 032e712313ae -r 05f2e370f113 mercurial/hgweb.py
--- a/mercurial/hgweb.py	Wed Aug 24 13:08:27 2005
+++ b/mercurial/hgweb.py	Wed Aug 24 14:24:32 2005
@@ -851,12 +851,12 @@
         virtual = virtual.strip('/')
 
         if len(virtual):
-            try:
+            if self.cp.has_option("paths", virtual):
                 real = self.cp.get("paths", virtual)
                 h = hgweb(real)
                 h.run()
                 return
-            except:
+            else:
                 httpnotfound(virtual)
                 return
 


More information about the Mercurial mailing list