Chromium Code Reviews| Index: Source/bindings/scripts/utilities.py |
| diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py |
| index 4d80ca7d1b3dc7df5f5e0b01676a68ec943456b6..0c2cad109e89917c18bb41dc5d60e2aa5d847700 100644 |
| --- a/Source/bindings/scripts/utilities.py |
| +++ b/Source/bindings/scripts/utilities.py |
| @@ -31,10 +31,20 @@ def idl_filename_to_component(idl_filename): |
| path = os.path.dirname(os.path.realpath(idl_filename)) |
| while path: |
| dirname, basename = os.path.split(path) |
| + if not basename: |
|
haraken
2014/10/09 04:24:00
When can this happen?
tasak
2014/10/10 07:52:22
I found that os.path.split('/') returns '/', None.
|
| + break |
| if basename.lower() in KNOWN_COMPONENTS: |
| return basename.lower() |
| path = dirname |
| - raise 'Unknown component type for %s' % idl_filename |
| + raise Exception('Unknown component type for %s' % idl_filename) |
| + |
| + |
| +def is_valid_component_dependency(component, dependency): |
| + assert component in KNOWN_COMPONENTS |
| + assert dependency in KNOWN_COMPONENTS |
| + if component == 'core' and dependency == 'modules': |
| + return False |
| + return True |
| ################################################################################ |