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