def _deleteOldRevisions(self):
        """Delete old versions of self's file, so that at most
        self._numSavedVersions versions are retained."""
        
        revisions = self._revisions()
        revisionsToDelete = revisions[:-self._numSavedVersions]
        for revision in revisionsToDelete:
            pathname = self._versionedName(revision)
            if os.path.isfile(pathname):
                os.remove(pathname)
Delete old versions of self's file, so that at most
        self._numSavedVersions versions are retained.
recipes/Python/52277_Saving_backups_when_writing/recipe-52277.py