summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/log.py
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-05-29 01:35:00 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-29 20:29:09 +0000
commit0cc53ef4bc2c7c69c62e71401a16bfefe2f23fce (patch)
treeda7ca4eef276dcfb41fb36dc7834180cd53af8e3 /src/osmo_gsm_tester/log.py
parentbef36bc5e3f3ab952820ff8955865d8a581dffd9 (diff)
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
Diffstat (limited to 'src/osmo_gsm_tester/log.py')
-rw-r--r--src/osmo_gsm_tester/log.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index 3af7bbe..c4a9861 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -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