Bug 974281 - Use mozfile.remove since rmtree is deprecated; r=ted draft
authorGregory Szorc <gps@mozilla.com>
Fri, 11 Mar 2016 15:08:54 -0800
changeset 394045 df392e8832e52501950f09acda208943c9e3d707
parent 393861 9ec789c0ee5bd3a5e765513c21027fdad953b022
child 394046 71ef2adbb931e2d7a9068a11d27a2b04a6e2012c
push id24468
push userbmo:gps@mozilla.com
push dateFri, 29 Jul 2016 00:03:24 +0000
reviewersted
bugs974281
milestone50.0a1
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,
 )
@@ -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