Skip to content

Commit

Permalink
update to guard in case package not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
nnshah1 committed Jan 6, 2024
1 parent 565bf9d commit 4c1ed33
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/python/library/tritonclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from importlib.metadata import version
from importlib.metadata import PackageNotFoundError, version

__version__ = version("tritonclient")
__version__ = "UNKNOWN"

try:
__version__ = version("tritonclient")
except PackageNotFoundError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
pass

del version

0 comments on commit 4c1ed33

Please sign in to comment.