diff options
author | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 03:47:26 -0500 |
---|---|---|
committer | Ian Bicking <ianb@colorstudy.com> | 2010-09-02 03:47:26 -0500 |
commit | 0209b2e9a3af0d6196a5b3749a352aaceee974b0 (patch) | |
tree | 7c34b06b5be88df9aa2bb46313969b634fa0ecfc | |
parent | 33283636f224c4f1c8ded247efca929f9a3ea55c (diff) | |
download | pastedeploy-git-0209b2e9a3af0d6196a5b3749a352aaceee974b0.tar.gz |
raise IOError instead of OSError on file-not-found (http://trac.pythonpaste.org/pythonpaste/ticket/428)
-rw-r--r-- | .hgignore | 4 | ||||
-rw-r--r-- | paste/deploy/loadwsgi.py | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..5139889 --- /dev/null +++ b/.hgignore @@ -0,0 +1,4 @@ +syntax: glob +*.egg-info/ +dist/ +build/ diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index 97c8dff..bae77ae 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -315,7 +315,7 @@ class _Loader(object): """ if name is None: return False - return self._absolute_re.search(name) + return self._absolute_re.search(name) class ConfigLoader(_Loader): @@ -328,11 +328,11 @@ class ConfigLoader(_Loader): # we have to add an extra check: if not os.path.exists(filename): if filename.strip() != filename: - raise OSError( + raise IOError( "File %r not found; trailing whitespace: " "did you try to use a # on the same line as a filename? " "(comments must be on their own line)" % filename) - raise OSError( + raise IOError( "File %r not found" % filename) self.parser.read(filename) self.parser._defaults.setdefault( |