forked from VimPlug/jedi
use del instead of assigning empty iterator
This commit is contained in:
@@ -196,7 +196,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
self._parse(code)
|
self._parse(code)
|
||||||
except:
|
except:
|
||||||
# FastParser is cached, be careful with exceptions
|
# FastParser is cached, be careful with exceptions
|
||||||
self.parsers[:] = []
|
del self.parsers[:]
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def update(self, code):
|
def update(self, code):
|
||||||
@@ -206,7 +206,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
self._parse(code)
|
self._parse(code)
|
||||||
except:
|
except:
|
||||||
# FastParser is cached, be careful with exceptions
|
# FastParser is cached, be careful with exceptions
|
||||||
self.parsers[:] = []
|
del self.parsers[:]
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def _split_parts(self, code):
|
def _split_parts(self, code):
|
||||||
@@ -222,7 +222,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
parts[-1] += '\n' + txt
|
parts[-1] += '\n' + txt
|
||||||
else:
|
else:
|
||||||
parts.append(txt)
|
parts.append(txt)
|
||||||
current_lines[:] = []
|
del current_lines[:]
|
||||||
|
|
||||||
r_keyword = '^[ \t]*(def|class|@|%s)' % '|'.join(tokenize.FLOWS)
|
r_keyword = '^[ \t]*(def|class|@|%s)' % '|'.join(tokenize.FLOWS)
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
return new
|
return new
|
||||||
|
|
||||||
parts = self._split_parts(code)
|
parts = self._split_parts(code)
|
||||||
self.parsers[:] = []
|
del self.parsers[:]
|
||||||
|
|
||||||
line_offset = 0
|
line_offset = 0
|
||||||
start = 0
|
start = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user