diff options
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r-- | src/engine/SCons/Util.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index a9b3421..1ffbd03 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -24,7 +24,7 @@ Various utility functions go here. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Util.py 5023 2010/06/14 22:05:46 scons" +__revision__ = "src/engine/SCons/Util.py 5134 2010/08/16 23:02:40 bdeegan" import os import sys @@ -459,22 +459,18 @@ def _semi_deepcopy_tuple(x): return tuple(map(semi_deepcopy, x)) d[tuple] = _semi_deepcopy_tuple -def _semi_deepcopy_inst(x): - if hasattr(x, '__semi_deepcopy__'): - return x.__semi_deepcopy__() - elif isinstance(x, UserDict): - return x.__class__(_semi_deepcopy_dict(x)) - elif isinstance(x, UserList): - return x.__class__(_semi_deepcopy_list(x)) - else: - return x -d[InstanceType] = _semi_deepcopy_inst - def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) if copier: return copier(x) else: + if hasattr(x, '__semi_deepcopy__'): + return x.__semi_deepcopy__() + elif isinstance(x, UserDict): + return x.__class__(_semi_deepcopy_dict(x)) + elif isinstance(x, UserList): + return x.__class__(_semi_deepcopy_list(x)) + return x |