Skip to content

Commit

Permalink
Add Python 3.8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hroncok committed Apr 22, 2019
1 parent e8fb75a commit d912aa5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sphinxcontrib/bibtex/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,19 @@ def visit_Name(self, node):
def visit_Set(self, node):
return frozenset(self.visit(elt) for elt in node.elts)

def visit_Str(self, node):
return node.s

# NameConstant is Python 3.4 only so do not insist on coverage
def visit_NameConstant(self, node): # pragma: no cover
return node.value

# Constant is Python 3.6+ only so do not insist on coverage
# Since 3.8 Num, Str, Bytes, NameConstant and Ellipsis are just Constant
def visit_Constant(self, node): # pragma: no cover
return node.value

# Not used on 3.8+
def visit_Str(self, node): # pragma: no cover
return node.s

def generic_visit(self, node):
_raise_invalid_node(node)

Expand Down

0 comments on commit d912aa5

Please sign in to comment.