Skip to content

Commit

Permalink
Fix profile model silent failure in Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ndevenish committed Apr 23, 2024
1 parent e0c47b6 commit aa33ddc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions newsfragments/XXX.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Miscellaneous other Python 3.12 changes.
11 changes: 7 additions & 4 deletions src/dxtbx/model/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import importlib.metadata
import logging
import sys

try:
profile_entry_points = importlib.metadata.entry_points()["dxtbx.profile_model"]
except KeyError:
profile_entry_points = []
if sys.version_info < (3, 10):
profile_entry_points = importlib.metadata.entry_points().get(
"dxtbx.profile_model", []
)
else:
profile_entry_points = importlib.metadata.entry_points(group="dxtbx.profile_model")


class ProfileModelFactory:
Expand Down

0 comments on commit aa33ddc

Please sign in to comment.