Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 27785:ba427b51f1d8
util: rename ctxmanager's __call__ method to enter
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Thu, 14 Jan 2016 09:31:01 -0800 |
parents | 4d10600c3f08 |
children | 14033c5dd261 |
comparison
equal
deleted
inserted
replaced
27784:432242f41d9f | 27785:ba427b51f1d8 |
---|---|
2653 self._atexit = [] | 2653 self._atexit = [] |
2654 | 2654 |
2655 def __enter__(self): | 2655 def __enter__(self): |
2656 return self | 2656 return self |
2657 | 2657 |
2658 def __call__(self): | 2658 def enter(self): |
2659 '''Create and enter context managers in the order in which they were | 2659 '''Create and enter context managers in the order in which they were |
2660 passed to the constructor.''' | 2660 passed to the constructor.''' |
2661 values = [] | 2661 values = [] |
2662 for func in self._pending: | 2662 for func in self._pending: |
2663 obj = func() | 2663 obj = func() |