Skip to content

Commit

Permalink
Merge branch '733-drop-python36' of github.com:twisted/pydoctor into …
Browse files Browse the repository at this point in the history
…733-drop-python36
  • Loading branch information
tristanlatr committed Sep 25, 2023
2 parents dcd04b0 + 69b026b commit 830d320
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pydoctor/astutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ def is_using_annotations(expr: Optional[ast.AST],
def is_none_literal(node: ast.expr) -> bool:
"""Does this AST node represent the literal constant None?"""
if sys.version_info >= (3,8):
# TODO: remove me when python3.7 is not supported anymore
return isinstance(node, ast.Constant) and node.value is None
else:
# TODO: remove me when python3.7 is not supported anymore
return isinstance(node, (ast.Constant, ast.NameConstant)) and node.value is None

def unstring_annotation(node: ast.expr, ctx:'model.Documentable', section:str='annotation') -> ast.expr:
Expand Down Expand Up @@ -391,6 +391,7 @@ def __instancecheck__(self, instance: object) -> bool:
return get_str_value(instance) is not None
return False
else:
# TODO: remove me when python3.7 is not supported
def __instancecheck__(self, instance: object) -> bool:
return isinstance(instance, ast.Str)

Expand All @@ -407,6 +408,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
if sys.version_info >= (3,8):
value: str
else:
# TODO: remove me when python3.7 is not supported
s: str

def extract_docstring_linenum(node: Str) -> int:
Expand Down

0 comments on commit 830d320

Please sign in to comment.