From c8588a40b0f9b5817f785e4e1294d3784da22eff Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 25 Jan 2010 00:45:31 +0100 Subject: darcs-fast-export: don't use urllib.urlopen().getcode() As it's missing from python2.5. --- exporters/darcs/darcs-fast-export | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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): -- cgit v1.2.1