IncludeFilePath = Match.group(1)\r
IncludeFilePath = self.ExpandMacros(IncludeFilePath)\r
PackagesPath = os.getenv("PACKAGES_PATH")\r
- for PackagePath in PackagesPath.split(os.pathsep):\r
- IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath))\r
- if os.path.exists(IncludeFilePathAbs):\r
- IncludeDsc = open(IncludeFilePathAbs, "r")\r
- break\r
+ if PackagesPath:\r
+ for PackagePath in PackagesPath.split(os.pathsep):\r
+ IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath))\r
+ if os.path.exists(IncludeFilePathAbs):\r
+ IncludeDsc = open(IncludeFilePathAbs, "r")\r
+ break\r
+ else:\r
+ IncludeDsc = open(IncludeFilePath, "r")\r
if IncludeDsc == None:\r
print("ERROR: Cannot open file '%s'" % IncludeFilePath)\r
raise SystemExit\r