]> granicus.if.org Git - python/commitdiff
Some changes (maybe not enough?) to make it work on Windows with local
authorGuido van Rossum <guido@python.org>
Mon, 26 Apr 1999 23:11:46 +0000 (23:11 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 26 Apr 1999 23:11:46 +0000 (23:11 +0000)
file URLs.

Tools/webchecker/webchecker.py

index 93078bb94bc380b5a94e1685a05a2ca1aa834cc9..352933854dbfa27894c5eb88d96d5a3593fd8953 100755 (executable)
@@ -606,9 +606,9 @@ class MyURLopener(urllib.FancyURLopener):
 
     def open_file(self, url):
         path = urllib.url2pathname(urllib.unquote(url))
-        if path[-1] != os.sep:
-            url = url + '/'
         if os.path.isdir(path):
+            if path[-1] != os.sep:
+                url = url + '/'
             indexpath = os.path.join(path, "index.html")
             if os.path.exists(indexpath):
                 return self.open_file(url + "index.html")
@@ -625,7 +625,7 @@ class MyURLopener(urllib.FancyURLopener):
                 s.write('<A HREF="%s">%s</A>\n' % (q, q))
             s.seek(0)
             return s
-        return urllib.FancyURLopener.open_file(self, path)
+        return urllib.FancyURLopener.open_file(self, url)
 
 
 class MyHTMLParser(sgmllib.SGMLParser):