From 8b93220d09adc6a56c9b0a7bfa3a9084e03ce25f Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 9 Nov 2011 04:24:46 +0100 Subject: quick fix to make the WiiArchiveU8 API a bit prettier --- src/wii/u8archive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wii/u8archive.py b/src/wii/u8archive.py index faad114..9ae1ef5 100644 --- a/src/wii/u8archive.py +++ b/src/wii/u8archive.py @@ -19,7 +19,10 @@ class WiiArchiveU8: if handle: if not hasattr(handle, 'read'): - handle = cStringIO.StringIO(handle) + if handle[0:4] == "U\xAA8\x2D": + handle = cStringIO.StringIO(handle) + else: + handle = open(handle, 'rb') info = WiiArchiveU8.ReadInfo() info.startPos = handle.tell() -- cgit v1.2.3