Message311507
The log_error method in refactor.RefactoringTool raises the exception:
def log_error(self, msg, *args, **kwds):
"""Called when an error occurs."""
raise
but every usage of it implies that it does not, e.g:
def refactor_string(self, data, name):
"""Refactor a given input string.
Args:
data: a string holding the code to be refactored.
name: a human-readable name for use in error/log messages.
Returns:
An AST corresponding to the refactored input stream; None if
there were errors during the parse.
"""
# [..]
try:
tree = self.driver.parse_string(data)
except Exception as err:
self.log_error("Can't parse %s: %s: %s",
name, err.__class__.__name__, err)
return
finally:
# [..]
This is the only explicit conflict I found in the documentation. From looking at the refactor_string function, it seems it should never raise on parse errors. Other uses of it are followed immediately by a return.
I'd like to see log_error only log the exception and continue. |
|
Date |
User |
Action |
Args |
2018-02-02 18:37:47 | soupytwist | set | recipients:
+ soupytwist |
2018-02-02 18:37:47 | soupytwist | set | messageid: <1517596667.28.0.467229070634.issue32750@psf.upfronthosting.co.za> |
2018-02-02 18:37:47 | soupytwist | link | issue32750 messages |
2018-02-02 18:37:47 | soupytwist | create | |
|