Skip to content

Commit

Permalink
Support older Pythons
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jul 8, 2024
1 parent 81bbd97 commit f8f93c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyperf/_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@


def get_hooks():
hook_prefix = "pyperf.hook"
entry_points = importlib.metadata.entry_points()
return (x.load() for x in entry_points.select(group="pyperf.hook"))
if sys.version_info[:2] < (3, 10):
group = entry_points[hook_prefix]
else:
group = entry_points.select(hook_prefix)
return (x.load() for x in group)


def get_hook_names():
Expand Down

0 comments on commit f8f93c1

Please sign in to comment.