diff options
author | Steven Knight <knight@baldmt.com> | 2010-05-17 01:30:17 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-05-17 01:30:17 (GMT) |
commit | a64cfe44e626ccb956a1b4c47e6d979519b3c8a2 (patch) | |
tree | 223557a025b18c8e29312901b0319d5e2849ae3a /src | |
parent | 5a772375ea28d2d0c3962abea4df731a1d017dc0 (diff) | |
download | SCons-a64cfe44e626ccb956a1b4c47e6d979519b3c8a2.zip SCons-a64cfe44e626ccb956a1b4c47e6d979519b3c8a2.tar.gz SCons-a64cfe44e626ccb956a1b4c47e6d979519b3c8a2.tar.bz2 |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Platform/__init__.py | 13 |
1 files 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: |