Skip to content

Commit

Permalink
add py39 dict syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry committed Aug 5, 2024
1 parent b6a0399 commit 17d790b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions weldx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import importlib.metadata
import sys
from pathlib import Path

import asdf
Expand Down Expand Up @@ -175,9 +176,13 @@ def enable_quality_standard(name: str, version: AsdfVersion | str = None):
@staticmethod
def load_installed_standards():
"""Load all standards that are installed to the active virtual environment."""
for entry_point in importlib.metadata.entry_points().select(
group="weldx.standard"
):
if sys.version_info < (3, 10):
entry_points = importlib.metadata.entry_points()["weldx.standard"]

Check warning on line 180 in weldx/config.py

View check run for this annotation

Codecov / codecov/patch

weldx/config.py#L180

Added line #L180 was not covered by tests
else:
entry_points = importlib.metadata.entry_points().select(
group="weldx.standard"
)
for entry_point in entry_points:
standards = entry_point.load()()
if not isinstance(standards, list):
standards = [standards]
Expand Down

0 comments on commit 17d790b

Please sign in to comment.