We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74f378e commit ded19e6Copy full SHA for ded19e6
1 file changed
magic.py
@@ -77,12 +77,9 @@ def from_buffer(self, buf):
77
return self._handle509Bug(e)
78
79
def from_file(self, filename):
80
- """
81
- Identify the contents of file `filename`
82
- raises IOError if the file does not exist
83
84
- if not os.path.exists(filename):
85
- raise IOError("File does not exist: " + filename)
+ # raise FileNotFoundException or IOError if the file does not exist
+ with open(filename):
+ pass
86
with self.lock:
87
try:
88
return magic_file(self.cookie, filename)
0 commit comments