Show More
@@ -80,8 +80,13 b' class zipit:' | |||||
80 |
|
80 | |||
81 | def __init__(self, dest, prefix, compress=True): |
|
81 | def __init__(self, dest, prefix, compress=True): | |
82 | self.prefix = tidyprefix(dest, prefix, ('.zip',)) |
|
82 | self.prefix = tidyprefix(dest, prefix, ('.zip',)) | |
83 |
if not isinstance(dest, str) |
|
83 | if not isinstance(dest, str): | |
84 | dest = tellable(dest) |
|
84 | try: | |
|
85 | dest.tell() | |||
|
86 | except AttributeError: | |||
|
87 | dest = tellable(dest) | |||
|
88 | except IOError: | |||
|
89 | dest = tellable(dest) | |||
85 | self.z = zipfile.ZipFile(dest, 'w', |
|
90 | self.z = zipfile.ZipFile(dest, 'w', | |
86 | compress and zipfile.ZIP_DEFLATED or |
|
91 | compress and zipfile.ZIP_DEFLATED or | |
87 | zipfile.ZIP_STORED) |
|
92 | zipfile.ZIP_STORED) |
General Comments 0
You need to be logged in to leave comments.
Login now