Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v7r2]Client: protect documentation generation against py3 #5233

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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