From c83fbe751e3a3d0f8e44eb97f9584f518b3a2b66 Mon Sep 17 00:00:00 2001 From: Manuel Francisco Naranjo Date: Mon, 21 Jul 2014 20:26:40 -0300 Subject: Prevent non defined named non defined exception In a project I'm running I hitted a case where BUILDERS is not part of _dict which leads to variable builders not defined, making the core of SCons crash --- src/engine/SCons/Environment.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index d178f49..7789855 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -1378,10 +1378,8 @@ class Base(SubstitutionEnvironment): (like a function). There are no references to any mutable objects in the original Environment. """ - try: - builders = self._dict['BUILDERS'] - except KeyError: - pass + + builders = self._dict.get('BUILDERS', {}) clone = copy.copy(self) # BUILDERS is not safe to do a simple copy -- cgit v0.12