Bug 974281 - Use mozfile.remove since rmtree is deprecated; r=ted
authorGregory Szorc <gps@mozilla.com>
Fri, 11 Mar 2016 15:08:54 -0800
changeset 309958 a09ef1eb1d63b45f249a4080cabd38d4954c3fe7
parent 309957 2544cfc9473e5b66d2e9b7692a34d9f167174c37
child 309959 c4c26c0af171a87e9ca40d938783ddc8fe03337f
push id31510
push usergszorc@mozilla.com
push dateThu, 18 Aug 2016 19:18:07 +0000
treeherderautoland@c4c26c0af171 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs974281
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
python/mozbuild/mozbuild/base.py
--- 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,
 )
@@ -301,17 +301,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