--- a/mercurial/archival.py Sun Apr 30 21:11:22 2006 +0200
+++ b/mercurial/archival.py Sun Apr 30 22:43:41 2006 +0200
@@ -80,8 +80,13 @@
def __init__(self, dest, prefix, compress=True):
self.prefix = tidyprefix(dest, prefix, ('.zip',))
- if not isinstance(dest, str) and not hasattr(dest, 'tell'):
- dest = tellable(dest)
+ if not isinstance(dest, str):
+ try:
+ dest.tell()
+ except AttributeError:
+ dest = tellable(dest)
+ except IOError:
+ dest = tellable(dest)
self.z = zipfile.ZipFile(dest, 'w',
compress and zipfile.ZIP_DEFLATED or
zipfile.ZIP_STORED)