fix: Put the stix2-pattern library import in a try statement

--> Error more easily caught
pull/201/head
chrisr3d 2018-07-02 12:14:21 +02:00
parent 5ff8bad85b
commit 90e42c0305
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
import json
from stix2patterns.validator import run_validator
try:
from stix2patterns.validator import run_validator
except ModuleNotFoundError:
print("stix2 patterns python library is missing, use 'pip3 install stix2-patterns' to install it.")
misperrors = {'error': 'Error'}
mispattributes = {'input': ['stix2-pattern'], 'output': ['text']}