##// END OF EJS Templates
atexit: switch to home-grown implementation
Bryan O'Sullivan -
r31958:de5c9d0e default
parent child Browse files
Show More
@@ -12,7 +12,6 b' prints it to ``stderr`` on exit.'
12 12 '''
13 13
14 14 from __future__ import absolute_import
15 import atexit
16 15
17 16 def memusage(ui):
18 17 """Report memory usage of the current process."""
@@ -29,4 +28,4 b' def memusage(ui):'
29 28 for k, v in result.iteritems()]) + "\n")
30 29
31 30 def extsetup(ui):
32 atexit.register(memusage, ui)
31 ui.atexit(memusage, ui)
@@ -7,7 +7,6 b''
7 7
8 8 from __future__ import absolute_import, print_function
9 9
10 import atexit
11 10 import difflib
12 11 import errno
13 12 import getopt
@@ -767,7 +766,7 b' def _dispatch(req):'
767 766 ui.warn(
768 767 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
769 768 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
770 atexit.register(print_time)
769 ui.atexit(print_time)
771 770
772 771 if options['verbose'] or options['debug'] or options['quiet']:
773 772 for opt in ('verbose', 'debug', 'quiet'):
@@ -7,7 +7,6 b''
7 7
8 8 from __future__ import absolute_import
9 9
10 import atexit
11 10 import collections
12 11 import contextlib
13 12 import errno
@@ -937,7 +936,7 b' class ui(object):'
937 936 if self._isatty(util.stderr):
938 937 os.dup2(pager.stdin.fileno(), util.stderr.fileno())
939 938
940 @atexit.register
939 @self.atexit
941 940 def killpager():
942 941 if util.safehasattr(signal, "SIGINT"):
943 942 signal.signal(signal.SIGINT, signal.SIG_IGN)
General Comments 0
You need to be logged in to leave comments. Login now