summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Util.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 6a7e4a1..7653acd 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -1425,14 +1425,22 @@ def AddMethod(obj, function, name=None):
else:
function = RenameFunction(function, name)
+ # Note the Python version checks - WLB
+ # Python 3.3 dropped the 3rd parameter from types.MethodType
if hasattr(obj, '__class__') and obj.__class__ is not type:
# "obj" is an instance, so it gets a bound method.
- method = MethodType(function, obj, obj.__class__)
- setattr(obj, name, method)
+ if sys.version_info[:2] > (3, 2):
+ method = MethodType(function, obj)
+ else:
+ method = MethodType(function, obj, obj.__class__)
else:
# "obj" is a class, so it gets an unbound method.
- function = MethodType(function, None, obj)
- setattr(obj, name, function)
+ if sys.version_info[:2] > (3, 2):
+ method = MethodType(function, None)
+ else:
+ method = MethodType(function, None, obj)
+
+ setattr(obj, name, method)
def RenameFunction(function, name):
"""