~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-25 06:02:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3755.
  • Revision ID: andrew.bennetts@canonical.com-20080925060210-h6gv3xs9s91lewl9
Minor tweaks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import socket
29
29
import sys
30
30
import urllib
31
 
import weakref
32
31
 
33
32
from bzrlib.lazy_import import lazy_import
34
33
lazy_import(globals(), """
 
34
import atexit
 
35
import weakref
35
36
from bzrlib import (
36
37
    debug,
37
38
    errors,
470
471
        return self._medium._get_line()
471
472
 
472
473
 
473
 
_atexit_registered = False
 
474
_atexit_counters = None
474
475
 
475
476
 
476
477
class _HPSSCallCounter(object):
494
495
        # program aborts with an exception the medium doesn't get
495
496
        # garbage-collected, presumably because one of the traceback frames
496
497
        # still references it.
497
 
        global _atexit_registered, _atexit_counters
498
 
        if not _atexit_registered:
499
 
            import atexit
 
498
        global _atexit_counters
 
499
        if _atexit_counters is None:
500
500
            _atexit_counters = []
501
501
            def finish_counters():
502
502
                for counter in list(_atexit_counters):