1
0
forked from VimPlug/jedi

New "with ignored(*exceptions)" context manager

This commit is contained in:
Danilo Bargen
2013-04-17 23:28:37 +02:00
parent 24573c5ef2
commit f98b0d7b6f
13 changed files with 51 additions and 73 deletions

View File

@@ -12,11 +12,11 @@ following functions (sometimes bug-prone):
- extract variable
- inline variable
"""
from __future__ import with_statement
import difflib
from jedi import common
from jedi import modules
from jedi import helpers
from jedi import parsing_representation as pr
@@ -168,7 +168,7 @@ def inline(script):
dct = {}
definitions = script.goto()
try:
with common.ignored(AssertionError):
assert len(definitions) == 1
stmt = definitions[0].definition
related_names = script.related_names()
@@ -202,7 +202,4 @@ def inline(script):
else:
new_lines.pop(index)
except AssertionError:
pass
return Refactoring(dct)