[checkout] Initialize self._nested in __init__
Just a minor cleanup - I like avoiding `getattr` as much as possible.
This would be a pylint error, except pylint doesn't know that `self`
here always refers a `CheckoutApi` instance.
We actually set self._nested = False initially (http://fxr/309690) but I
think I deleted it by accident when I got rid of the checkout recipe
module properties - I assumed I could get rid of the __init__ method
entirely.
Change-Id: Iaf8f35696b455a7b99d536d624d4ac338084500b
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index 64d04ca..0f4dc54 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -64,7 +64,7 @@
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
- if not getattr(self, '_nested', False):
+ if not self._nested:
with self.m.step.nest('checkout'):
self._nested = True
env = {}
@@ -90,6 +90,10 @@
CheckoutResults = CheckoutResults
+ def __init__(self, *args, **kwargs):
+ super(CheckoutApi, self).__init__(*args, **kwargs)
+ self._nested = False
+
@_nest
def with_options(self,
path,