diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -252,8 +252,8 @@ class bundlerepository(localrepo.localre def __del__(self): del self.bundle - if tempfile is not None: - os.unlink(tempfile) + if self.tempfile is not None: + os.unlink(self.tempfile) if self._tempparent: shutil.rmtree(self._tempparent, True)