~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/atomicfile.py

Abbreviate pack_stat struct format to '>6L'

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.lazy_import import lazy_import
21
21
lazy_import(globals(), """
22
22
import stat
23
 
import socket
24
23
import warnings
25
24
 
26
25
from bzrlib import (
81
80
            if stat.S_IMODE(st.st_mode) != new_mode:
82
81
                os.chmod(self.tmpfilename, new_mode)
83
82
 
84
 
    def _get_closed(self):
85
 
        symbol_versioning.warn('AtomicFile.closed deprecated in bzr 0.10',
86
 
                               DeprecationWarning, stacklevel=2)
87
 
        return self._fd is None
88
 
 
89
 
    closed = property(_get_closed)
90
 
 
91
83
    def __repr__(self):
92
84
        return '%s(%r)' % (self.__class__.__name__,
93
85
                           self.realfilename)
119
111
        """Discard the file unless already committed."""
120
112
        if self._fd is not None:
121
113
            self.abort()
122
 
 
123
 
    def __del__(self):
124
 
        if self._fd is not None:
125
 
            warnings.warn("%r leaked" % self)