Index: tools/grit/grit/grd_reader.py |
diff --git a/tools/grit/grit/grd_reader.py b/tools/grit/grit/grd_reader.py |
index ba8ad49feed2de62fc18659f1a3e3a6b8a424a74..c337b6f2c8ef632b70d5428a4e482650a3d4b3bb 100755 |
--- a/tools/grit/grit/grd_reader.py |
+++ b/tools/grit/grit/grd_reader.py |
@@ -84,13 +84,10 @@ class GrdContentHandler(xml.sax.handler.ContentHandler): |
partnode = self.stack[-1] |
partnode.started_inclusion = True |
# Add the contents of the sub-grd file as children of the <part> node. |
- partname = partnode.GetInputPath() |
- if os.path.dirname(partname): |
- # TODO(benrg): Remove this limitation. (The problem is that GRIT |
- # assumes that files referenced from the GRD file are relative to |
- # a path stored in the root <grit> node.) |
- raise exception.GotPathExpectedFilenameOnly() |
- partname = os.path.join(self.dir, partname) |
+ partname = os.path.join(self.dir, partnode.GetInputPath()) |
+ # Check the GRDP file exists. |
+ if not os.path.exists(partname): |
+ raise exception.FileNotFound() |
# Exceptions propagate to the handler in grd_reader.Parse(). |
xml.sax.parse(partname, GrdPartContentHandler(self)) |