From 4b3a032823160c0c4560a4644223691ee4f12fc7 Mon Sep 17 00:00:00 2001 From: Greg Noel Date: Thu, 20 May 2010 14:16:08 +0000 Subject: Apply changes caught by fixer plus trivial optimizations --- src/engine/SCons/Util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index dd47259..738f2b5 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -33,7 +33,6 @@ import SCons.compat import copy import os -import os.path import re import sys import types @@ -476,7 +475,7 @@ def _semi_deepcopy_inst(x): return x.__class__(_semi_deepcopy_list(x)) else: return x -d[types.InstanceType] = _semi_deepcopy_inst +d[InstanceType] = _semi_deepcopy_inst def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) @@ -1376,7 +1375,7 @@ def AddMethod(obj, function, name=None): else: function = RenameFunction(function, name) - if hasattr(obj, '__class__') and obj.__class__ != types.TypeType: + if hasattr(obj, '__class__') and obj.__class__ is not type: # "obj" is an instance, so it gets a bound method. setattr(obj, name, types.MethodType(function, obj, obj.__class__)) else: -- cgit v0.12