summaryrefslogtreecommitdiff
path: root/magic.py
diff options
context:
space:
mode:
Diffstat (limited to 'magic.py')
-rw-r--r--magic.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/magic.py b/magic.py
index 710023b..c6142a7 100644
--- a/magic.py
+++ b/magic.py
@@ -77,12 +77,9 @@ class Magic:
return self._handle509Bug(e)
def from_file(self, filename):
- """
- Identify the contents of file `filename`
- raises IOError if the file does not exist
- """
- if not os.path.exists(filename):
- raise IOError("File does not exist: " + filename)
+ # raise FileNotFoundException or IOError if the file does not exist
+ with open(filename):
+ pass
with self.lock:
try:
return magic_file(self.cookie, filename)