From 58603671c21b0af30d0d52fec862c5843c6e50d0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 9 Aug 2018 13:45:55 +0200 Subject: Cleanup of class scoped variables After bug described in OS#3456 and fixed in last commit, let's categorize and place variables in its correct plac to avoid similar issus. We leave under the class keyword (class scoped variables) the attributes which are to be used as static class attributes. All other ones are initialized during __init__(). This way w avoid scenarios in which while using an object from an instance attribute we end up reading a class scoped variable which is shared among all instances. Change-Id: I5ad4cac34a9f49eaf42966c01c9c5a4d3f3e9dc8 --- src/osmo_gsm_tester/process.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/osmo_gsm_tester/process.py') diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index c13ded0..ad2405d 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -29,13 +29,11 @@ from .util import Dir class Process(log.Origin): - process_obj = None - outputs = None - result = None - killed = None - def __init__(self, name, run_dir, popen_args, **popen_kwargs): super().__init__(log.C_RUN, name) + self.process_obj = None + self.result = None + self.killed = None self.name_str = name self.run_dir = run_dir self.popen_args = popen_args -- cgit v1.2.3