log.Origin: return self on __enter__
Allows using 'with some_origin() as foo:' constructs. Not used actively, but is sometimes useful during debugging sessions. Change-Id: I7a6463ee39761775305dd2272c24f248552db4ad
This commit is contained in:
parent
bef36bc5e3
commit
0cc53ef4bc
|
@ -332,8 +332,9 @@ class Origin:
|
|||
|
||||
def __enter__(self):
|
||||
if not self.set_child_of(Origin._global_current_origin):
|
||||
return
|
||||
return self
|
||||
Origin._global_current_origin = self
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_info):
|
||||
rc = None
|
||||
|
|
Loading…
Reference in New Issue