[Zope-Checkins] CVS: Packages/ZConfig - Context.py:1.5

Fred L. Drake, Jr. fdrake@acm.org
Wed, 16 Oct 2002 17:12:51 -0400


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv21502

Modified Files:
	Context.py 
Log Message:
Use a cleaner way of detecting fragment identifiers (and faster when
there isn't one -- the common case).


=== Packages/ZConfig/Context.py 1.4 => 1.5 ===
--- Packages/ZConfig/Context.py:1.4	Tue Oct 15 14:28:29 2002
+++ Packages/ZConfig/Context.py	Wed Oct 16 17:12:50 2002
@@ -111,7 +111,8 @@
     # internal helpers
 
     def _parse_url(self, url, section):
-        if urlparse.urlparse(url)[-1]:
+        url, fragment = urlparse.urldefrag(url)
+        if fragment:
             raise ConfigurationError(
                 "fragment identifiers are not currently supported")
         file = urllib2.urlopen(url)