Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Can we make a good faith attempt to support 2.6?
# YES WE CAN!
p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = p.communicate()[0].strip().decode('utf-8')
if p.returncode > 0:
err = subprocess.CalledProcessError(p.returncode, cmd)
err.output = out
raise err
if len(out) > 0:
print(out)
if __name__ == '__main__':
if args.version:
print(pdoc.__version__)
sys.exit(0)
# We close stdin because some modules, upon import, are not very polite
# and block on stdin.
try:
sys.stdin.close()
except:
pass
if not args.http and args.module_name is None:
_eprint('No module name specified.')
sys.exit(1)
if args.template_dir is not None:
pdoc.tpl_lookup.directories.insert(0, args.template_dir)
# If PYTHONPATH is set, let it override everything if we want it to.