File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 107107dll_ = dll_prefix
108108
109109try :
110+ # Note: if the ninja python package is not installed, this import statement can end
111+ # up finding the scons/test/ninja directory instead, and successfully importing
112+ # that directory as an implicit namespace package. Therefore if ninja is
113+ # unavailable, we may not get an ImportError here, but can instead get an
114+ # AttributeError when attempting to access ninja.BIN_DIR below. This happens
115+ # when running individual test files in the test/ directory, since the test/
116+ # directory will then be listed as the first entry in sys.path
110117 import ninja
111118
112119 NINJA_BINARY = os .path .abspath (os .path .join (ninja .BIN_DIR , 'ninja' + _exe ))
113- except ImportError :
120+ except ( ImportError , AttributeError ) :
114121 NINJA_BINARY = None
115122
116123if sys .platform == 'cygwin' :
You can’t perform that action at this time.
0 commit comments