[jhbuild] don't treat c:... as URL on Windows



commit 6a8797506b8f8f3d92669cc0063b2d9818a3b9a0
Author: Frédéric Péters <fpeters 0d be>
Date:   Thu May 21 19:37:54 2009 +0200

    don't treat c:... as URL on Windows
---
 jhbuild/utils/httpcache.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/jhbuild/utils/httpcache.py b/jhbuild/utils/httpcache.py
index 0e72f3e..17a6fb7 100644
--- a/jhbuild/utils/httpcache.py
+++ b/jhbuild/utils/httpcache.py
@@ -29,6 +29,7 @@ and draws ideas from feedparser.py.  Strategies include:
 '''
 
 import os
+import sys
 import urllib2
 import urlparse
 import time
@@ -166,6 +167,9 @@ class Cache:
         parts = urlparse.urlparse(uri)
         if parts[0] in ('', 'file'):
             return parts[2]
+        if sys.platform.startswith('win') and uri[1] == ':':
+            # On Windows, path like c:... are local
+            return uri
 
         now = time.time()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]