[Erp5-report] r14276 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 27 14:50:13 CEST 2007


Author: jerome
Date: Fri Apr 27 14:50:13 2007
New Revision: 14276

URL: http://svn.erp5.org?rev=3D14276&view=3Drev
Log:
Make an explicit check that uid is not an integer (long cannot be compared =
with
is keyword).


Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=
=3D14276&r1=3D14275&r2=3D14276&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Fri Apr 27 14:50:13 2007
@@ -1462,9 +1462,8 @@
         if index is not None and index < 0:
           raise CatalogError, 'A negative uid %d is used for %s. Your cata=
log is broken. Recreate your catalog.' % (index, path)
         if index:
-          # Use "is not" instead of "!=3D", because we want to make sure t=
hat
-          # uid becomes long, if it is int.
-          if uid is not index:
+          if uid !=3D index or isinstance(uid, int):
+            # We want to make sure that uid becomes long if it is an int
             LOG('SQLCatalog', WARNING, 'uid of %r changed from %r (propert=
y) to %r (catalog, by path) !!! This can be fatal. You should reindex the w=
hole site immediately.' % (object, uid, index))
             uid =3D index
             object.uid =3D uid




More information about the Erp5-report mailing list