mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
prevent SystemError from happening through literal_eval
This commit is contained in:
@@ -190,7 +190,7 @@ class Parser(CachedModule):
|
||||
def get_doc(obj, indent=False):
|
||||
doc = inspect.getdoc(obj)
|
||||
if doc:
|
||||
doc = ('"""\n%s\n"""\n' % doc)
|
||||
doc = ('r"""\n%s\n"""\n' % doc)
|
||||
if indent:
|
||||
doc = parsing.indent_block(doc)
|
||||
return doc
|
||||
|
||||
@@ -154,6 +154,8 @@ class Scope(Simple):
|
||||
def add_docstr(self, string):
|
||||
""" Clean up a docstring """
|
||||
self.docstr = cleandoc(literal_eval(string))
|
||||
# TODO raises a SystemError here, report:
|
||||
#literal_eval(r"'\U'")
|
||||
|
||||
def add_import(self, imp):
|
||||
self.imports.append(imp)
|
||||
|
||||
Reference in New Issue
Block a user