]> git.madduck.net Git - etc/vim.git/blob - tests/comments3.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Support --diff for both files and stdin
[etc/vim.git] / tests / comments3.py
1 def func():
2     lcomp3 = [
3         # This one is actually too long to fit in a single line.
4         element.split("\n", 1)[0]
5         # yup
6         for element in collection.select_elements()
7         # right
8         if element is not None
9     ]
10     # Capture each of the exceptions in the MultiError along with each of their causes and contexts
11     if isinstance(exc_value, MultiError):
12         embedded = []
13         for exc in exc_value.exceptions:
14             if exc not in _seen:
15                 embedded.append(
16                     # This should be left alone (before)
17                     traceback.TracebackException.from_exception(
18                         exc,
19                         limit=limit,
20                         lookup_lines=lookup_lines,
21                         capture_locals=capture_locals,
22                         # copy the set of _seen exceptions so that duplicates
23                         # shared between sub-exceptions are not omitted
24                         _seen=set(_seen),
25                     )
26                     # This should be left alone (after)
27                 )
28
29     # everything is fine if the expression isn't nested
30     traceback.TracebackException.from_exception(
31         exc,
32         limit=limit,
33         lookup_lines=lookup_lines,
34         capture_locals=capture_locals,
35         # copy the set of _seen exceptions so that duplicates
36         # shared between sub-exceptions are not omitted
37         _seen=set(_seen),
38     )