diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -17,7 +17,7 @@ import pushkey as pushkeymod 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 @@ class remotebatch(batcher): 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,))