Grokzen / redis-py-cluster

Python cluster client for the official redis cluster. Redis 3.0+.
https://redis-py-cluster.readthedocs.io/
MIT License
1.1k stars 315 forks source link

SyntaxWarning due to comparison using is for literal #351

Closed tirkarthi closed 4 years ago

tirkarthi commented 4 years ago

I will raise a PR for this.

./tests/test_multiprocessing.py:50: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert proc.exitcode is 0
./tests/test_multiprocessing.py:84: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert proc.exitcode is 0
./tests/test_multiprocessing.py:112: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert proc.exitcode is 0
./tests/test_multiprocessing.py:151: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert proc.exitcode is 0
./tests/test_multiprocessing.py:164: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert proc.exitcode is 0
./tests/test_cluster_obj.py:70: DeprecationWarning: invalid escape sequence \.
  assert re.search('^RedisCluster<[a-z0-9\.\:\,].+>$', str(r))
Grokzen commented 4 years ago

@tirkarthi Since this is something from upstream redis-py so the PR should not be made here, but in the upstream repo instead and it will flow down to this repo eventually.

Also note that this issue is something python 3.8 specific it seems as it do not show in runtimes before 3.8.

Grokzen commented 4 years ago

Acctually when i look at it, it seems that it is already fixed in the master branch for redis-py. But it was done after the 3.3.11 release, that is why i did not pick it up as i only checked on the last stable released code when i merge all the tests from that upstream repo down here.

tirkarthi commented 4 years ago

Thanks for the details. I didn't know these are from upstream. The code was in this repo that made me file it.

Feel free to close it as needed.

Grokzen commented 4 years ago

Dont worry, not all of the code is from upstream, and it is a little bit difficult to see what belongs to where at this point in time. In some cases i have to modify the test that i bring down, in some cases i can leave it unmodified, and in some cases i have to block them out or write a completely new test for the feature. My guess is that they will make a release 3.3.12 before i am done with all of the porting and cod eupdates on my end that i am currently working on. so i will get in the fixes from upstream before 2.1 is out here i am sure.