diff options
Diffstat (limited to 'exporters')
-rwxr-xr-x | exporters/darcs/darcs-fast-export | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/exporters/darcs/darcs-fast-export b/exporters/darcs/darcs-fast-export index d8a04b0..4417bd4 100755 --- a/exporters/darcs/darcs-fast-export +++ b/exporters/darcs/darcs-fast-export @@ -34,6 +34,7 @@ import subprocess import optparse import re import urllib +import urllib2 import StringIO sys = reload(sys) @@ -154,7 +155,11 @@ class Handler: if os.path.exists(path): return True else: - return urllib.urlopen(path).getcode() == 200 + try: + urllib2.urlopen(urllib2.Request(path)) + return True + except urllib2.HTTPError, e: + return False # this is like open, but supports urls as well def open(self, path): |