check for plain file type, too

This commit is contained in:
Martin A. Brown 2016-02-12 23:59:13 -08:00
parent fe507461e8
commit 82a8a21d18
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,8 @@ class SourceDocument(object):
self.filename = os.path.abspath(filename)
if not os.path.exists(self.filename):
raise OSError("Missing source document: " + self.filename)
if not os.path.isfile(self.filename):
raise OSError("Wrong type, not a plain file: " + self.filename)
logger.debug("Found existing %s", self.filename)
self.dirname, self.basename = os.path.split(self.filename)