From a64cfe44e626ccb956a1b4c47e6d979519b3c8a2 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Mon, 17 May 2010 01:30:17 +0000 Subject: Convert old-style classes in Platform/__init.py to new-style classes. Add an explicit PlatformSpec.__call__() method to handle behavioral difference in new-style classes. --- src/engine/SCons/Platform/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py index e1066f0..81a49e7 100644 --- a/src/engine/SCons/Platform/__init__.py +++ b/src/engine/SCons/Platform/__init__.py @@ -120,14 +120,18 @@ def DefaultToolList(platform, env): """ return SCons.Tool.tool_list(platform, env) -class PlatformSpec: - def __init__(self, name): +class PlatformSpec(object): + def __init__(self, name, generate): self.name = name + self.generate = generate + + def __call__(self, *args, **kw): + return self.generate(*args, **kw) def __str__(self): return self.name -class TempFileMunge: +class TempFileMunge(object): """A callable class. You can set an Environment variable to this, then call it with a string argument, then it will perform temporary file substitution on it. This is used to circumvent the long command @@ -227,8 +231,7 @@ def Platform(name = platform_default()): """Select a canned Platform specification. """ module = platform_module(name) - spec = PlatformSpec(name) - spec.__call__ = module.generate + spec = PlatformSpec(name, module.generate) return spec # Local Variables: -- cgit v0.12