Skip to content

Commit

Permalink
fix: Avoid exception on dev releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Nov 15, 2024
1 parent 226f291 commit 0d88a9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymisp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def __init__(self, url: str, key: str, ssl: bool | str = True, debug: bool = Fal
if 'errors' in response:
logger.warning(response['errors'][0])
else:
pymisp_version_tup = tuple(int(x) for x in __version__.split('.'))
recommended_version_tup = tuple(int(x) for x in response['version'].split('.'))
pymisp_version_tup = tuple(int(x) for x in __version__.split('.')[:3])
recommended_version_tup = tuple(int(x) for x in response['version'].split('.')[:3])
if recommended_version_tup < pymisp_version_tup[:3]:
logger.info(f"The version of PyMISP recommended by the MISP instance ({response['version']}) is older than the one you're using now ({__version__}). If you have a problem, please upgrade the MISP instance or use an older PyMISP version.")
elif pymisp_version_tup[:3] < recommended_version_tup:
Expand Down

0 comments on commit 0d88a9d

Please sign in to comment.