OLD | NEW |
---|---|
1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
2 # | 2 # |
3 # SCons - a Software Constructor | 3 # SCons - a Software Constructor |
4 # | 4 # |
5 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S Cons Foundation | 5 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S Cons Foundation |
6 # | 6 # |
7 # Permission is hereby granted, free of charge, to any person obtaining | 7 # Permission is hereby granted, free of charge, to any person obtaining |
8 # a copy of this software and associated documentation files (the | 8 # a copy of this software and associated documentation files (the |
9 # "Software"), to deal in the Software without restriction, including | 9 # "Software"), to deal in the Software without restriction, including |
10 # without limitation the rights to use, copy, modify, merge, publish, | 10 # without limitation the rights to use, copy, modify, merge, publish, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 else: | 154 else: |
155 # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*. | 155 # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*. |
156 libpath, tail = os.path.split(libpath) | 156 libpath, tail = os.path.split(libpath) |
157 # Split /usr/libfoo/python* to /usr/libfoo | 157 # Split /usr/libfoo/python* to /usr/libfoo |
158 libpath, tail = os.path.split(libpath) | 158 libpath, tail = os.path.split(libpath) |
159 # Check /usr/libfoo/scons*. | 159 # Check /usr/libfoo/scons*. |
160 prefs.append(libpath) | 160 prefs.append(libpath) |
161 | 161 |
162 try: | 162 try: |
163 import pkg_resources | 163 import pkg_resources |
164 except ImportError: | 164 # BEGIN MODIFICATION |
165 # It is known that importing pkg_resources can result in: | |
166 # An ImportError | |
Mark Seaborn
2011/03/30 20:07:14
add "or" on the end?
| |
167 # A distutils.errors.DistutilsPlatformError | |
Mark Seaborn
2011/03/30 20:07:14
You told me that this is considered a Python bug w
| |
168 # Vanila SCons only catches an ImportError. | |
Mark Seaborn
2011/03/30 20:07:14
"vanilla"
| |
169 # The other exception gets throw on the mac toolchain bot because it | |
Mark Seaborn
2011/03/30 20:07:14
mac -> Mac
| |
170 # sets MACOSX_DEPLOYMENT_TARGET to an older version. | |
171 # In practice, it doesn't matter why importing pkg_resources fails, so | |
172 # it's reasonable to catch every exception. | |
173 except Exception: | |
174 # END MODIFICATION | |
165 pass | 175 pass |
166 else: | 176 else: |
167 # when running from an egg add the egg's directory | 177 # when running from an egg add the egg's directory |
168 try: | 178 try: |
169 d = pkg_resources.get_distribution('scons') | 179 d = pkg_resources.get_distribution('scons') |
170 except pkg_resources.DistributionNotFound: | 180 except pkg_resources.DistributionNotFound: |
171 pass | 181 pass |
172 else: | 182 else: |
173 prefs.append(d.location) | 183 prefs.append(d.location) |
174 | 184 |
(...skipping 12 matching lines...) Expand all Loading... | |
187 import SCons.Script | 197 import SCons.Script |
188 # this does all the work, and calls sys.exit | 198 # this does all the work, and calls sys.exit |
189 # with the proper exit status when done. | 199 # with the proper exit status when done. |
190 SCons.Script.main() | 200 SCons.Script.main() |
191 | 201 |
192 # Local Variables: | 202 # Local Variables: |
193 # tab-width:4 | 203 # tab-width:4 |
194 # indent-tabs-mode:nil | 204 # indent-tabs-mode:nil |
195 # End: | 205 # End: |
196 # vim: set expandtab tabstop=4 shiftwidth=4: | 206 # vim: set expandtab tabstop=4 shiftwidth=4: |
OLD | NEW |