Skip to content

Commit

Permalink
Client: protect documentation generation against py3
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Jun 29, 2021
1 parent 54ea9a2 commit 0923c8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DIRAC/Core/Base/Client.py
Expand Up @@ -36,6 +36,7 @@ def __get__(self, instance, owner):

class partialmethodWithDoc(partialmethod):
"""Extension of meth:`functools.partialmethod` that preserves docstrings"""

def __get__(self, instance, owner):
func = super(partialmethodWithDoc, self).__get__(instance, owner)
func.__doc__ = self.__doc__
Expand Down Expand Up @@ -169,11 +170,11 @@ def addFunctions(clientCls):
"%s.%sSystem.Service" % (extension, systemName),
"%s.py" % handlerModuleName,
)
fullHandlerClassPath = '%s.%s' % (extension, handlerClassPath)
with path as fp:
handlerAst = ast.parse(fp.read_text(), str(path))
except (ImportError, OSError):
continue
fullHandlerClassPath = '%s.%s' % (extension, handlerClassPath)
with path as fp:
handlerAst = ast.parse(fp.read_text(), str(path))

# loop over all the nodes (classes, functions, imports) in the handlerModule
for node in ast.iter_child_nodes(handlerAst):
Expand Down

0 comments on commit 0923c8c

Please sign in to comment.