--- a/mercurial/wireproto.py Mon Jul 25 16:04:44 2011 -0500
+++ b/mercurial/wireproto.py Mon Jul 25 16:05:01 2011 -0500
@@ -17,7 +17,7 @@
class future(object):
'''placeholder for a value to be set later'''
def set(self, value):
- if hasattr(self, 'value'):
+ if util.safehasattr(self, 'value'):
raise error.RepoError("future is already set")
self.value = value
@@ -58,8 +58,9 @@
req, rsp = [], []
for name, args, opts, resref in self.calls:
mtd = getattr(self.remote, name)
- if hasattr(mtd, 'batchable'):
- batchable = getattr(mtd, 'batchable')(mtd.im_self, *args, **opts)
+ batchablefn = getattr(mtd, 'batchable', None)
+ if batchablefn is not None:
+ batchable = batchablefn(mtd.im_self, *args, **opts)
encargsorres, encresref = batchable.next()
if encresref:
req.append((name, encargsorres,))