Skip to content

Commit

Permalink
fix: Handle Div nodes for values
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Nov 22, 2021
1 parent e08bcfa commit 272e4d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/griffe/node_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ast import Constant as NodeConstant
from ast import Dict as NodeDict
from ast import DictComp as NodeDictComp
from ast import Div as NodeDiv
from ast import Ellipsis as NodeEllipsis
from ast import Expr as NodeExpr
from ast import FormattedValue as NodeFormattedValue
Expand Down Expand Up @@ -245,6 +246,10 @@ def _get_mult_value(node: NodeMult) -> str:
return "*"


def _get_div_value(node: NodeDiv) -> str:
return "/"


def _get_unaryop_value(node: NodeUnaryOp) -> str:
return f"{get_value(node.op)}{get_value(node.operand)}"

Expand Down Expand Up @@ -432,6 +437,7 @@ def _get_call_value(node: NodeCall) -> str:
NodeUAdd: _get_uadd_value,
NodeNot: _get_not_value,
NodeArguments: _get_arguments_value,
NodeDiv: _get_div_value,
}

if sys.version_info < (3, 9):
Expand Down

0 comments on commit 272e4d6

Please sign in to comment.