fixed unmatched elif (#1872)

This commit is contained in:
jphilipsen05 2016-06-03 09:41:10 -07:00 committed by Markus Unterwaditzer
parent f034d2e271
commit fe5f714026
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 '