From 51209a9c15bc04cc7f3644c1c0053245280146fb Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 25 Dec 2019 17:51:43 +0100 Subject: [PATCH] Fix string comparison (use != instead of is not) Python 3.8 gives a warning for us in `zope/sqlalchemy/datamanager.py:132`: SyntaxWarning: "is not" with a literal. Did you mean "!="? That warning seems correct, and the `is not` might even lead to unintended results. So this line should probably be changed to `!=` . --- src/zope/sqlalchemy/datamanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zope/sqlalchemy/datamanager.py b/src/zope/sqlalchemy/datamanager.py index c95aa05..75fadca 100644 --- a/src/zope/sqlalchemy/datamanager.py +++ b/src/zope/sqlalchemy/datamanager.py @@ -129,7 +129,7 @@ def tpc_finish(self, trans): pass def tpc_abort(self, trans): - assert self.state is not "committed" + assert self.state != "committed" def sortKey(self): # Try to sort last, so that we vote last - we may commit in tpc_vote(),