def check_package(self, package, package_dir):
try:<EOL><INDENT>return self.packages_checked[package]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>init_py = _build_py.check_package(self, package, package_dir)<EOL>self.packages_checked[package] = init_py<EOL>if not init_py or not self.distribution.namespace_packages:<EOL><INDENT>return init_py<EOL><DEDENT>for pkg in self.distribution.namespace_packages:<EOL><INDENT>if pkg==package or pkg.startswith(package+'<STR_LIT:.>'):<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return init_py<EOL><DEDENT>f = open(init_py,'<STR_LIT>')<EOL>if '<STR_LIT>'.encode() not in f.read():<EOL><INDENT>from distutils import log<EOL>log.warn(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>'<STR_LIT>'<EOL>"<STR_LIT>", package<EOL>)<EOL><DEDENT>f.close()<EOL>return init_py<EOL>
Check namespace packages' __init__ for declare_namespace