--- a/mercurial/byterange.py Mon Jul 25 15:07:09 2011 -0500
+++ b/mercurial/byterange.py Mon Jul 25 15:09:17 2011 -0500
@@ -103,9 +103,7 @@
"""This effectively allows us to wrap at the instance level.
Any attribute not found in _this_ object will be searched for
in self.fo. This includes methods."""
- if hasattr(self.fo, name):
- return getattr(self.fo, name)
- raise AttributeError(name)
+ return getattr(self.fo, name)
def tell(self):
"""Return the position within the range.
@@ -170,10 +168,8 @@
offset is relative to the current position (self.realpos).
"""
assert offset >= 0
- if not hasattr(self.fo, 'seek'):
- self._poor_mans_seek(offset)
- else:
- self.fo.seek(self.realpos + offset)
+ seek = getattr(self.fo, 'seek', self._poor_mans_seek)
+ seek(self.realpos + offset)
self.realpos += offset
def _poor_mans_seek(self, offset):