Bug 974281 - Use mozfile.remove since rmtree is deprecated; r=ted
My Python editor told me rmtree has been marked as deprecated. Use
mozfile.remove instead.
MozReview-Commit-ID: FYkXk1fnxvC
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -11,17 +11,17 @@ import multiprocessing
import os
import subprocess
import sys
import which
from mach.mixin.logging import LoggingMixin
from mach.mixin.process import ProcessExecutionMixin
-from mozfile.mozfile import rmtree
+from mozfile.mozfile import remove as mozfileremove
from .backend.configenvironment import ConfigEnvironment
from .controller.clobber import Clobberer
from .mozconfig import (
MozconfigFindException,
MozconfigLoadException,
MozconfigLoader,
)
@@ -328,17 +328,17 @@ class MozbuildObject(ProcessExecutionMix
def remove_objdir(self):
"""Remove the entire object directory."""
if sys.platform.startswith('win') and self.have_winrm():
subprocess.check_call(['winrm', '-rf', self.topobjdir])
else:
# We use mozfile because it is faster than shutil.rmtree().
# mozfile doesn't like unicode arguments (bug 818783).
- rmtree(self.topobjdir.encode('utf-8'))
+ mozfileremove(self.topobjdir.encode('utf-8'))
def get_binary_path(self, what='app', validate_exists=True, where='default'):
"""Obtain the path to a compiled binary for this build configuration.
The what argument is the program or tool being sought after. See the
code implementation for supported values.
If validate_exists is True (the default), we will ensure the found path