Commit ebfa0c9a authored by Maxime Perrotin's avatar Maxime Perrotin

Create cache folder if missing, instead of reporting an error

parent 32b705f5
......@@ -135,6 +135,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
2.1.1 (10/2019)
- Create cache folder if it was missing
2.1.0 (09/2019)
- Reinforce type checks when using substrings and indexes, and
variable-length arrays. the latter can no longer be indexed on the
......
......@@ -84,9 +84,12 @@ def parse_asn1(*files, **options):
# use basic caching to avoid re-parsing when loading the model
project_cache = os.getenv ("PROJECT_CACHE")
if project_cache is not None and not os.path.isdir(project_cache):
raise TypeError (
"The configured cache folder \""
+ project_cache + "\" is not there!\n")
try:
print("[INFO] Creating cache folder {}".format(project_cache))
os.makedirs(project_cache)
except OSError:
raise TypeError ("The configured cache folder \""
+ project_cache + "\" is not there and could not be created\n")
# make sure the same files are not parsed more than once if not modified
filehash = hashlib.md5()
file_list = sorted(list(*files))
......
......@@ -141,7 +141,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '2.1.0'
__version__ = '2.1.1'
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