Skip to content

Commit

Permalink
Merge pull request #5233 from chaen/rel-v7r2_FIX_addFunctions
Browse files Browse the repository at this point in the history
[v7r2]Client: protect documentation generation against py3
  • Loading branch information
Andrei Tsaregorodtsev committed Jul 2, 2021
2 parents acd599f + 0923c8c commit 524815a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DIRAC/Core/Base/Client.py
Original file line number Diff line number Diff line change
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 524815a

Please sign in to comment.