Index: tools/grit/grit/node/include.py |
diff --git a/tools/grit/grit/node/include.py b/tools/grit/grit/node/include.py |
index 032674bdd2f9a13924d8a43ca5de1337f72b9eb9..e9ea31cad7947a39499bbed935fd8bb0b4f49fc9 100644 |
--- a/tools/grit/grit/node/include.py |
+++ b/tools/grit/grit/node/include.py |
@@ -57,10 +57,9 @@ class IncludeNode(base.Node): |
id_map = rc_header.Item.tids_ |
id = id_map[self.GetTextualIds()[0]] |
filename = self.FilenameToOpen() |
- if not os.path.exists(filename): |
- # Try to open the file relative to the output dir if it's not relative to |
- # the grd file. |
- filename = os.path.join(output_dir, self.attrs['file']) |
+ if self.attrs['flattenhtml'] == 'true': |
+ # If the file was flattened, the flattened file is in the output dir. |
+ filename = os.path.join(output_dir, os.path.split(filename)[1]) |
file = open(filename, 'rb') |
data = file.read() |