IOError prints filename. Very useful for debugging

This commit is contained in:
Lubos Kocman
2016-07-15 15:05:35 +02:00
parent 490da57176
commit ef48854aa6

View File

@@ -56,7 +56,7 @@ def from_file(filename=None):
if not isinstance(filename, str):
raise TypeError("The configuration filename must be a string.")
if not os.path.isfile(filename):
raise IOError("The configuration file doesn't exist.")
raise IOError("The configuration file '%s' doesn't exist." % filename)
cp = configparser.ConfigParser(allow_no_value=True)
cp.read(filename)
default = cp.defaults()