From: cclauss Date: Thu, 3 May 2018 06:24:24 +0000 (+0200) Subject: Don't forget self in table_formatter.py X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~627^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de99f53e94d724890677f6b06d2b58e3a8ee3104;p=platform%2Fupstream%2Fopencv.git Don't forget self in table_formatter.py __ridx__ is an _undefined name_ in this context but __self.ridx__ is used three other times in this method and nine times in this class. Undefined names may raise [NameError](https://docs.python.org/3/library/exceptions.html#NameError) at runtime. flake8 testing of https://github.com/opencv/opencv $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./modules/ts/misc/table_formatter.py:50:23: F821 undefined name 'ridx' self.rows[ridx + 1].props = properties ^ ``` --- diff --git a/modules/ts/misc/table_formatter.py b/modules/ts/misc/table_formatter.py index caa1e86..2592e52 100755 --- a/modules/ts/misc/table_formatter.py +++ b/modules/ts/misc/table_formatter.py @@ -47,7 +47,7 @@ class table(object): if len(self.rows) - 1 == self.ridx: self.rows.append(tblRow(len(self.columns), properties)) else: - self.rows[ridx + 1].props = properties + self.rows[self.ridx + 1].props = properties self.ridx += 1 return self.rows[self.ridx]