Merge lp://staging/~vmiklos/bzr-fastimport/darcs into lp://staging/bzr-fastimport

Proposed by Miklos Vajna
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~vmiklos/bzr-fastimport/darcs
Merge into: lp://staging/bzr-fastimport
Diff against target: 24 lines (+6/-1)
1 file modified
exporters/darcs/darcs-fast-export (+6/-1)
To merge this branch: bzr merge lp://staging/~vmiklos/bzr-fastimport/darcs
Reviewer Review Type Date Requested Status
Ian Clatworthy Approve
Review via email: mp+17983@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Miklos Vajna (vmiklos) wrote :

python 2.5 fix

269. By Ian Clatworthy

Merge Python 2.5 fix for darcs-fast-export

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

I'll merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'exporters/darcs/darcs-fast-export'
2--- exporters/darcs/darcs-fast-export 2009-10-22 10:26:32 +0000
3+++ exporters/darcs/darcs-fast-export 2010-01-24 23:48:14 +0000
4@@ -34,6 +34,7 @@
5 import optparse
6 import re
7 import urllib
8+import urllib2
9 import StringIO
10
11 sys = reload(sys)
12@@ -154,7 +155,11 @@
13 if os.path.exists(path):
14 return True
15 else:
16- return urllib.urlopen(path).getcode() == 200
17+ try:
18+ urllib2.urlopen(urllib2.Request(path))
19+ return True
20+ except urllib2.HTTPError, e:
21+ return False
22
23 # this is like open, but supports urls as well
24 def open(self, path):

Subscribers

People subscribed via source and target branches