Comment 5 for bug 1259349

Revision history for this message
Răzvan-Cosmin Rădulescu (razvancosmin-radulescu) wrote : Re: Using list comprehensions

I attached my whole snippets file and hope it helps. I made only slight modifications to the original python.snippets file in the global portion. The part that gives the error is located at line 312 (the only print statement in the file to make it easy to find).

Thank you. Hope this is enough information...

Then to get the erorr I only: def<tab>... and then it gives me:

An error occured. This is either a bug in UltiSnips or a bug in a
snippet definition. If you think this is a bug, please report it to
https://bugs.launchpad.net/ultisnips/+filebug.

Following is the full stack trace:
Traceback (most recent call last):
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/__init__.py", line 23, in wrapper
    return f(self, *args, **kwds)
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/__init__.py", line 602, in expand_or_jump
    rv = self._try_expand()
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/__init__.py", line 934, in _try_expand
    self._do_snippet(snippet, before, after)
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/__init__.py", line 908, in _do_snippet
    si = snippet.launch(text_before, self._visual_content, None, start, end)
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/__init__.py", line 420, in launch
    last_re = self._last_re, globals = self._globals)
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/text_objects/_snippet_instance.py", line 34, in __init__
    self.update_textobjects()
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/text_objects/_snippet_instance.py", line 70, in update_textobjects
    if obj._update(done, not_done):
  File "/home/razvan/.vim/bundle/ultisnips/plugin/UltiSnips/text_objects/_python_code.py", line 216, in _update
    compatible_exec(self._code, self._globals, local_d)
  File "<string>", line 10, in <module>
  File "<string>", line 10, in <listcomp>
NameError: global name 're' is not defined