summaryrefslogtreecommitdiff
path: root/Lib/atexit.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/atexit.py')
-rw-r--r--Lib/atexit.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/atexit.py b/Lib/atexit.py
index c9f4cc6775..93fddf7f99 100644
--- a/Lib/atexit.py
+++ b/Lib/atexit.py
@@ -40,8 +40,11 @@ def register(func, *targs, **kargs):
func - function to be called at exit
targs - optional arguments to pass to func
kargs - optional keyword arguments to pass to func
+
+ func is returned to facilitate usage as a decorator.
"""
_exithandlers.append((func, targs, kargs))
+ return func
if hasattr(sys, "exitfunc"):
# Assume it's another registered exit function - append it to our list