(distribution, group, name)
| 68 | |
| 69 | |
| 70 | def load_entry_point(distribution, group, name): |
| 71 | dist_obj = importlib_metadata.distribution(distribution) |
| 72 | eps = [ep for ep in dist_obj.entry_points |
| 73 | if ep.group == group and ep.name == name] |
| 74 | if not eps: |
| 75 | raise ImportError("Entry point %r not found" % ((group, name),)) |
| 76 | return eps[0].load() |
| 77 | |
| 78 | |
| 79 | def load_class(uri, default="gunicorn.workers.sync.SyncWorker", |