Commit 23c18831 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add error handling when asn1 file not found

parent 6eaeb89c
......@@ -141,10 +141,13 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
2.0.7 (05/2018)
- Minor bugfix
2.0.7 (05/2018)
- Add option to generate code with QGen (C and Ada)
- Better reporting of model parsing error
\
2.0.6 (05/2018)
- Several fixes with the Append operator when working on complex types
......
......@@ -84,8 +84,11 @@ def parse_asn1(*files, **options):
# make sure the same files are not parsed more than once if not modified
filehash = hashlib.md5()
file_list = list(*files)
for each in file_list:
filehash.update(open(each).read())
try:
for each in file_list:
filehash.update(open(each).read())
except IOError as err:
raise TypeError (str(err))
new_hash = filehash.hexdigest()
fileset = "".join(file_list)
if fileset in AST.viewkeys() and AST[fileset]['hash'] == new_hash:
......@@ -107,7 +110,7 @@ def parse_asn1(*files, **options):
if os.name == 'posix':
path_to_mono = spawn.find_executable('mono')
if not path_to_mono:
raise TypeErorr('"mono" not found in path. Please install it.')
raise TypeError('"mono" not found in path. Please install it.')
binary = path_to_mono
arg0 = path_to_asn1scc
else:
......
......@@ -141,7 +141,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '2.0.7'
__version__ = '2.0.8'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment