diff options
author | W. Trevor King <wking@drexel.edu> | 2009-10-05 21:00:34 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-10-05 21:00:34 -0400 |
commit | aa7546258e3f24bec3df2d8c4b203ed08e0acbce (patch) | |
tree | d93b3c47e74e62524238f6e7dea03acf735988de /libbe/vcs.py | |
parent | e35ccf95ea89b6e622202caae30d3b8cca3f2473 (diff) | |
download | bugseverywhere-aa7546258e3f24bec3df2d8c4b203ed08e0acbce.tar.gz |
Moved from *.__del__() to exclusive use of *.cleanup().
*.__del__() is run some unspecified time after the refcount for an
object is reduced to zero. Sometimes that means that the rest of the
world has already been deallocated, which makes life difficult,
especially when Python won't attempt to construct stack traces inside
*.__del__(). We were always (hopefully ;) calling del(*) anyway,
so we just replace those calls with *.cleanup()
Diffstat (limited to 'libbe/vcs.py')
-rw-r--r-- | libbe/vcs.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libbe/vcs.py b/libbe/vcs.py index a1d3022..6975a83 100644 --- a/libbe/vcs.py +++ b/libbe/vcs.py @@ -50,7 +50,7 @@ def _get_matching_vcs(matchfn): vcs = module.new() if matchfn(vcs) == True: return vcs - del(vcs) + vcs.cleanup() return VCS() def vcs_by_name(vcs_name): @@ -124,8 +124,6 @@ class VCS(object): self._duplicateBasedir = None self._duplicateDirname = None self.encoding = encoding - def __del__(self): - self.cleanup() def _vcs_help(self): """ @@ -674,7 +672,7 @@ class VCSTestCase(unittest.TestCase): setup_vcs_test_fixtures(self) def tearDown(self): - del(self.vcs) + self.vcs.cleanup() super(VCSTestCase, self).tearDown() def full_path(self, rel_path): |