fixed unmatched elif

Also update relevant test
This commit is contained in:
Josiah Philipsen 2016-06-02 15:06:55 -07:00 committed by Markus Unterwaditzer
parent f91aea2aa0
commit 41e08f4ccd
2 changed files with 11 additions and 4 deletions

View file

@ -55,10 +55,10 @@ def prepare_exec_for_file(filename):
module = []
# Chop off file extensions or package markers
if filename.endswith('.py'):
filename = filename[:-3]
elif os.path.split(filename)[1] == '__init__.py':
if os.path.split(filename)[1] == '__init__.py':
filename = os.path.dirname(filename)
elif filename.endswith('.py'):
filename = filename[:-3]
else:
raise NoAppException('The file provided (%s) does exist but is not a '
'valid Python file. This means that it cannot '