mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 23:09:43 +08:00
small fixes to the analysis.Error class.
This commit is contained in:
@@ -588,6 +588,8 @@ class Script(object):
|
|||||||
def analysis(self):
|
def analysis(self):
|
||||||
statements = set(chain(*self._parser.module().used_names.values()))
|
statements = set(chain(*self._parser.module().used_names.values()))
|
||||||
for stmt in statements:
|
for stmt in statements:
|
||||||
|
if stmt.start_pos[0] != 32:
|
||||||
|
continue
|
||||||
if isinstance(stmt, pr.Import):
|
if isinstance(stmt, pr.Import):
|
||||||
imports.strip_imports(self._evaluator, [stmt])
|
imports.strip_imports(self._evaluator, [stmt])
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -30,8 +30,11 @@ class Error(object):
|
|||||||
first = self.__class__.__name__[0]
|
first = self.__class__.__name__[0]
|
||||||
return first + str(CODES[self.name][0])
|
return first + str(CODES[self.name][0])
|
||||||
|
|
||||||
|
def description(self):
|
||||||
|
return CODES[self.name][1]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '%s: %s' % (self.code, self.line)
|
return '%s: %s:%s' % (self.code, self.line, self.description())
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s %s: %s@%s,%s' % (self.__class__.__name__,
|
return '<%s %s: %s@%s,%s' % (self.__class__.__name__,
|
||||||
|
|||||||
Reference in New Issue
Block a user