Skip to content

Commit

Permalink
fix for Pytho< 3.8 support in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <phorton@sonatype.com>
  • Loading branch information
madpah committed Oct 11, 2021
1 parent 53a82cf commit c9b6019
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@
# Copyright (c) OWASP Foundation. All Rights Reserved.

import json
import sys
import xml.etree.ElementTree
from datetime import datetime, timezone
from importlib.metadata import version
from unittest import TestCase
from uuid import uuid4
from xml.dom import minidom

if sys.version_info >= (3, 8, 0):
from importlib.metadata import version
else:
from importlib_metadata import version

cyclonedx_lib_name: str = 'cyclonedx-python-lib'
cyclonedx_lib_version: str = version(cyclonedx_lib_name)
single_uuid: str = 'urn:uuid:{}'.format(uuid4())
Expand Down

0 comments on commit c9b6019

Please sign in to comment.