summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-04-19 05:32:22 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-04-19 05:32:22 +0200
commiteaca5f3629f6eb90b9257d6abdb2207cf930aad5 (patch)
tree8485e00a9370b8a6b16bd2edb299bbb805768f31
parenta75ebb7c6b558feb9a3b93ace6cbca54bccb067a (diff)
downloadpython-linuxnamespaces-eaca5f3629f6eb90b9257d6abdb2207cf930aad5.tar.gz
examples/cgroup.py: use asyncio.run
-rwxr-xr-xexamples/cgroup.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/cgroup.py b/examples/cgroup.py
index da222f9..8fa8457 100755
--- a/examples/cgroup.py
+++ b/examples/cgroup.py
@@ -121,9 +121,7 @@ def main() -> None:
# hierarchy is immediately writeable. For others, we may create a scope
# unit.
if ravel is not None:
- asyncio.get_event_loop().run_until_complete(
- start_transient_unit_with_ravel(os.getpid())
- )
+ asyncio.run(start_transient_unit_with_ravel(os.getpid()))
mycgroup = get_cgroup()
else:
# Re-execute ourselves via systemd-run.