Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abb103b

Browse files
author
Michael W. Hudson
committed
Don't use 'is not' to compare strings.
(spotted by reading pypy-svn :)
1 parent 7c5e618 commit abb103b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class A:
353353
try:
354354
A().a # Raised AttributeError: A instance has no attribute 'a'
355355
except AttributeError, x:
356-
if str(x) is not "booh":
356+
if str(x) != "booh":
357357
print "attribute error for A().a got masked:", str(x)
358358

359359
class E:

0 commit comments

Comments
 (0)