Dolda2000 GitWeb
/
pdm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fec2bc0
)
Add reload function to perf.sysctl.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 11 Jun 2024 14:09:50 +0000
(16:09 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 11 Jun 2024 14:09:50 +0000
(16:09 +0200)
pdm/perf.py
patch
|
blob
|
blame
|
history
diff --git
a/pdm/perf.py
b/pdm/perf.py
index
7aef95a
..
7c93c85
100644
(file)
--- a/
pdm/perf.py
+++ b/
pdm/perf.py
@@
-278,4
+278,12
@@
sysinfo["uname"] = simpleattr(func = os.uname)
sysinfo["hostname"] = simpleattr(func = socket.gethostname)
sysinfo["platform"] = valueattr(init = sys.platform)
-sysctl = simplefunc(exit=lambda status=0: os._exit(status))
+def reload(modname):
+ mod = sys.modules.get(modname)
+ if mod is None:
+ raise ValueError(modname)
+ import importlib
+ importlib.reload(mod)
+
+sysctl = simplefunc(exit=lambda status=0: os._exit(status),
+ reload=reload)