Use 'is' to compare with None

Issues were detected by PyCharm Community Edition 3.4.
Merge pull request #6642 from JIghtuse/master

Use 'is' to compare with None