summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingLiu <liu.jing5@zte.com.cn>2016-12-22 17:37:36 +0800
committerJingLiu <liu.jing5@zte.com.cn>2016-12-22 17:37:36 +0800
commit90399f9fe92e4a3096559c4ceeced776b426091b (patch)
tree094036f32441ed0421c558bde62ee97dc95defcc
parentbdb5a076276c244439f02d2e697c48ba1d51c7a4 (diff)
downloadoslo-log-90399f9fe92e4a3096559c4ceeced776b426091b.tar.gz
Replace method attr in vars() to hasattr3.20.0
As ChangBo Guo(gcb) said in review https://review.openstack.org/#/c/359786, 'hasattr' has less cost than 'vars'. Repair it in another place. Change-Id: Ib13767be8377f536a9d82e54a6e7af8b6a8a1604
-rw-r--r--oslo_log/tests/unit/test_log.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/oslo_log/tests/unit/test_log.py b/oslo_log/tests/unit/test_log.py
index e0c254f..12f04bd 100644
--- a/oslo_log/tests/unit/test_log.py
+++ b/oslo_log/tests/unit/test_log.py
@@ -1416,7 +1416,7 @@ class LogConfigTestCase(BaseTestCase):
super(LogConfigTestCase, self).setUp()
names = self.create_tempfiles([('logging', MIN_LOG_INI)])
self.log_config_append = names[0]
- if 'old_time' in vars(log._load_log_config):
+ if hasattr(log._load_log_config, 'old_time'):
del log._load_log_config.old_time
def test_log_config_append_ok(self):