Show More
@@ -10,7 +10,6 b' from __future__ import absolute_import' | |||
|
10 | 10 | import contextlib |
|
11 | 11 | import os |
|
12 | 12 | import struct |
|
13 | import warnings | |
|
14 | 13 | |
|
15 | 14 | from .i18n import _ |
|
16 | 15 | from . import ( |
@@ -568,12 +567,13 b' def generatev2(repo):' | |||
|
568 | 567 | |
|
569 | 568 | @contextlib.contextmanager |
|
570 | 569 | def nested(*ctxs): |
|
571 | with warnings.catch_warnings(): | |
|
572 | # For some reason, Python decided 'nested' was deprecated without | |
|
573 | # replacement. They officially advertised for filtering the deprecation | |
|
574 | # warning for people who actually need the feature. | |
|
575 | warnings.filterwarnings("ignore",category=DeprecationWarning) | |
|
576 | with contextlib.nested(*ctxs): | |
|
570 | this = ctxs[0] | |
|
571 | rest = ctxs[1:] | |
|
572 | with this: | |
|
573 | if rest: | |
|
574 | with nested(*rest): | |
|
575 | yield | |
|
576 | else: | |
|
577 | 577 | yield |
|
578 | 578 | |
|
579 | 579 | def consumev2(repo, fp, filecount, filesize): |
General Comments 0
You need to be logged in to leave comments.
Login now