code-saturne / code_saturne

code_saturne public mirror
https://www.code-saturne.org
GNU General Public License v2.0
225 stars 82 forks source link

Python syntax warning: "is" with a literal. Did you mean "=="? #78

Closed christoph-conrads closed 3 years ago

christoph-conrads commented 3 years ago

Code from bin/cs_mei_to_c.py, line 2344:

                if zone.getNature()['initialization'] is 'on':

Warning on Ubuntu 20.04 with Python 3.8.5:

/tmp/prefix/lib/python2.7/site-packages/code_saturne/cs_mei_to_c.py:2344: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if zone.getNature()['initialization'] is 'on':

The warning looks justified to me.

YvanFournier commented 3 years ago

Hello,

Yes, this was already cleaned up in later versions. Since v6.0 is in "bug fix"/porting mode only, we may or may not change this in a future release.

YvanFournier commented 3 years ago

Fixed in commit 31781289b (v6.0 branch, will be n v6.0.7).