Skip to content
Browse files

MB-5988: more except-as idiom conversion

Apparently, I missed several files in the last attempt at python 2.4
cleanup in commit b4a272b.

Change-Id: Ie8d15dd50ef8faa0d843b843217e06ee376cfd89
Reviewed-on: http://review.couchbase.org/18994
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 61f2cd7 commit f1bccb9d369bb3a0d6628559c542ace2a13396bd @steveyen steveyen committed
Showing with 13 additions and 13 deletions.
  1. +2 −2 pump_mc.py
  2. +10 −10 pump_sfd.py
  3. +1 −1 pump_tap.py
View
4 pump_mc.py
@@ -212,7 +212,7 @@ def recv_msgs(self, conn, msgs, vbucket_id=None):
else:
return "error: MCSink MC error: " + str(r_status), None
- except Exception as e:
+ except Exception, e:
logging.error("MCSink exception: %s", e)
return "error: MCSink exception: " + str(e), None
@@ -368,7 +368,7 @@ def recv(self, skt, nbytes, buf):
data = skt.recv(max(nbytes - len(buf), 4096))
except socket.timeout:
logging.error("error: recv socket.timeout")
- except Exception as e:
+ except Exception, e:
logging.error("error: recv exception: " + str(e))
if not data:
View
20 pump_sfd.py
@@ -88,11 +88,11 @@ def vbucket_states(opts, spec, bucket_dir):
else:
return "error: missing vbucket_state from: %s" \
% (f), None
- except Exception as e:
+ except Exception, e:
return ("error: could not read _local/vbstate from: %s" +
"; exception: %s") % (f, e), None
store.close()
- except Exception as e:
+ except Exception, e:
return ("error: could not read couchstore file: %s" +
"; exception: %s") % (f, e), None
@@ -125,13 +125,13 @@ def provide_design(opts, source_spec, source_bucket, source_map):
if not doc_info.deleted:
try:
doc_contents = doc_info.getContents()
- except Exception as e:
+ except Exception, e:
return ("error: could not read design doc: %s" +
"; source_spec: %s; exception: %s") % \
(doc_info.id, source_spec, e), None
try:
doc = json.loads(doc_contents)
- except ValueError as e:
+ except ValueError, e:
return ("error: could not parse design doc: %s" +
"; source_spec: %s; exception: %s") % \
(doc_info.id, source_spec, e), None
@@ -226,7 +226,7 @@ def change_callback(doc_info):
try:
store = couchstore.CouchStore(f, 'r')
- except Exception as e:
+ except Exception, e:
self.queue.put(("error: could not open couchstore file: %s"
"; exception: %s" % (f, e), None))
return
@@ -325,7 +325,7 @@ def run(self):
store.commit()
store.close()
- except Exception as e:
+ except Exception, e:
self.future_done(future,
"error: could not save couchstore data"
"; vbucket_id: %s; store_path: %s"
@@ -342,7 +342,7 @@ def save_vbucket_state(self, store, vbucket_id,
'max_deleted_seqno': str(max_deleted_seqno)})
try:
store.localDocs['_local/vbstate'] = doc
- except Exception as e:
+ except Exception, e:
return "error: save_vbucket_state() failed: " + str(e)
return 0
@@ -381,7 +381,7 @@ def consume_design(opts, sink_spec, sink_map,
try:
sd = json.loads(source_design)
- except ValueError as e:
+ except ValueError, e:
return "error: could not parse source_design: " + source_design
rv, d = data_dir(sink_spec)
@@ -448,7 +448,7 @@ def find_bucket_dir(self):
if not os.path.isdir(bucket_dir):
try:
os.mkdir(bucket_dir)
- except OSError as e:
+ except OSError, e:
return ("error: could not create bucket_dir: %s; exception: %s"
% (bucket_dir, e)), None
@@ -467,7 +467,7 @@ def open_latest_store(bucket_dir, glob_pattern, filter_re, default_name, mode='c
"; found: %s") % (glob_pattern, store_paths), None, None
try:
return 0, couchstore.CouchStore(str(store_paths[0]), mode), store_paths[0]
- except Exception as e:
+ except Exception, e:
return ("error: could not open couchstore file: %s" +
"; exception: %s") % (store_paths[0], e), None, None
View
2 pump_tap.py
@@ -300,7 +300,7 @@ def recv(self, skt, nbytes, buf):
data = skt.recv(max(nbytes - len(buf), self.recv_min_bytes))
except socket.timeout:
logging.error("error: recv socket.timeout")
- except Exception as e:
+ except Exception, e:
logging.error("error: recv exception: " + str(e))
if not data:

0 comments on commit f1bccb9

Please sign in to comment.
Something went wrong with that request. Please try again.