diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-19 05:06:30 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-19 05:06:30 (GMT) |
commit | 3c89670aa4432fe14c22a87641f54e036d087290 (patch) | |
tree | 21f9b93d961c23cd8f37c939fb55e24a2d176459 /src/engine/SCons/compat | |
parent | 3e8b9fbf66460441d239ff0e503452baa5532496 (diff) | |
download | SCons-3c89670aa4432fe14c22a87641f54e036d087290.zip SCons-3c89670aa4432fe14c22a87641f54e036d087290.tar.gz SCons-3c89670aa4432fe14c22a87641f54e036d087290.tar.bz2 |
Remove the compat shutil.move() function.
Diffstat (limited to 'src/engine/SCons/compat')
-rw-r--r-- | src/engine/SCons/compat/__init__.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index e7f3232..78dcf94 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -229,45 +229,6 @@ except ImportError: imp.load_module('queue', file, filename, suffix_mode_type) -import shutil -try: - shutil.move -except AttributeError: - # Pre-2.3 Python has no shutil.move() function. - # - # Cribbed from Python 2.5. - import os - - def move(src, dst): - """Recursively move a file or directory to another location. - - If the destination is on our current filesystem, then simply use - rename. Otherwise, copy src to the dst and then remove src. - A lot more could be done here... A look at a mv.c shows a lot of - the issues this implementation glosses over. - - """ - try: - os.rename(src, dst) - except OSError: - if os.path.isdir(src): - if shutil.destinsrc(src, dst): - raise Error("Cannot move a directory '%s' into itself '%s'." % (src, dst)) - shutil.copytree(src, dst, symlinks=True) - shutil.rmtree(src) - else: - shutil.copy2(src,dst) - os.unlink(src) - shutil.move = move - del move - - def destinsrc(src, dst): - src = os.path.abspath(src) - return os.path.abspath(dst)[:len(src)] == src - shutil.destinsrc = destinsrc - del destinsrc - - try: import subprocess except ImportError: |