From 6e2d52ceee25005bc9af2de3f77c5fe2a915b155 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 6 Nov 2011 20:35:11 -0500 Subject: [PATCH] This should really raise an error if file not found --- overviewer_core/nbt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/overviewer_core/nbt.py b/overviewer_core/nbt.py index 895eca9..ef8536a 100644 --- a/overviewer_core/nbt.py +++ b/overviewer_core/nbt.py @@ -18,14 +18,13 @@ import struct import StringIO import os import numpy +from functools import wraps # decorator to handle filename or object as first parameter def _file_loader(func): + @wraps(func) def wrapper(fileobj, *args): if isinstance(fileobj, basestring): - if not os.path.isfile(fileobj): - return None - # Is actually a filename fileobj = open(fileobj, 'rb',4096) return func(fileobj, *args)