mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-20 09:45:12 +03:00
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
From bcd7e72b406ac532d487f0504d760e857c6fee70 Mon Sep 17 00:00:00 2001
|
|
From: Sunjay Cauligi <scauligi@eng.ucsd.edu>
|
|
Date: Fri, 26 Feb 2021 17:10:33 -0800
|
|
Subject: [PATCH] Fix: don't insert stdlib when generating docs
|
|
|
|
---
|
|
sphinxcontrib/hydomain.py | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/sphinxcontrib/hydomain.py b/sphinxcontrib/hydomain.py
|
|
index abb3fac..f93d24e 100644
|
|
--- a/sphinxcontrib/hydomain.py
|
|
+++ b/sphinxcontrib/hydomain.py
|
|
@@ -82,7 +82,7 @@ def bool_option(arg):
|
|
|
|
def hy2py(source: str) -> str:
|
|
hst = hy.lex.hy_parse(source)
|
|
- ast = hy.compiler.hy_compile(hst, "__main__")
|
|
+ ast = hy.compiler.hy_compile(hst, "__main__", import_stdlib=False)
|
|
return astor.code_gen.to_source(ast)
|
|
|
|
|
|
@@ -90,7 +90,7 @@ def signature_from_str(signature: str) -> inspect.Signature:
|
|
# NOTE Likely where the crash on -sentinel bug is happening
|
|
code = "(defn func" + signature + ")"
|
|
hst = hy.lex.hy_parse(code)
|
|
- module = hy.compiler.hy_compile(hst, "__main__")
|
|
+ module = hy.compiler.hy_compile(hst, "__main__", import_stdlib=False)
|
|
function = cast(ast.FunctionDef, module.body[0])
|
|
|
|
return signature_from_ast(function)
|