Skip to content

Commit

Permalink
Merge pull request #91 from redcanaryco/dev/cbr
Browse files Browse the repository at this point in the history
Upgrade cbapi to support Python 3.10+
  • Loading branch information
rc-csmith authored Jan 19, 2023
2 parents 37a0320 + 509e131 commit fe4b437
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
16 changes: 0 additions & 16 deletions load.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import os
import sys
from typing import Type, Iterable

import click

from common import Product

# import all files in the 'products' folder
Expand All @@ -14,11 +11,6 @@

sub_module = module[:-3]

# cbapi module has broken imports for Python 3.10+
# importing it here would result in none of the products working on Python 3.10+
if sub_module == 'vmware_cb_response':
continue

__import__('products.' + sub_module, locals(), globals())
del module

Expand All @@ -42,14 +34,6 @@ def get_product_instance(product: str, **kwargs) -> Product:
"""
Get an instance of the product implementation matching the specified product string.
"""
if product == 'cbr':
if sys.version_info.major == 3 and sys.version_info.minor > 9:
click.secho(f'cbr only functions on Python 3.9 due to a library limitation', fg='red')
exit(1)

from products.vmware_cb_response import CbResponse
return CbResponse(**kwargs)

for subclass in _get_subclasses():
if subclass.product == product:
return subclass(**kwargs)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
click~=8.0.4
cbapi~=1.7.0
cbapi~=1.7.9
requests~=2.27.1
setuptools~=60.6.0
tqdm~=4.63.0
Expand Down

0 comments on commit fe4b437

Please sign in to comment.