Change import hook to require modules to end in '_capnp'

This commit is contained in:
Jason Paryani
2013-09-01 23:55:29 -07:00
parent 98c9b959f7
commit 891f0d28e5
2 changed files with 26 additions and 2 deletions

View File

@@ -1165,6 +1165,11 @@ class _Importer:
module_name = mod_parts[-1]
else:
module_name = fullname
if not module_name.endswith('_capnp'):
return None
module_name = module_name.rstrip('_capnp')
capnp_module_name = module_name + self.extension
if package_path: