[Spambayes] Missing 2.0 compatibility lines in storage.py

FrançoisGranger francois.granger at free.fr
Sun Dec 29 00:41:44 EST 2002


Fresh install on MacOSX with the standard Python distribution:

[fbg:/volumes/OS99/spambayes] fgranger% python
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Fresh download from CVS, I get the following errors.

[fbg:/volumes/OS99/spambayes] fgranger% python hammiebulk.py
Traceback (most recent call last):
   File "hammiebulk.py", line 53, in ?
     import hammie
   File "hammie.py", line 5, in ?
     import storage
   File "storage.py", line 57, in ?
     NO_UPDATEPROBS = False   # Probabilities will not be autoupdated 
with training
NameError: name 'False' is not defined
[fbg:/volumes/OS99/spambayes] fgranger% python hammie.py
Traceback (most recent call last):
   File "hammie.py", line 5, in ?
     import storage
   File "storage.py", line 57, in ?
     NO_UPDATEPROBS = False   # Probabilities will not be autoupdated 
with training
NameError: name 'False' is not defined
[fbg:/volumes/OS99/spambayes] fgranger%

Just added these cutted and pasted lines at the biggining of the file:

try:
     True, False, bool
except NameError:
     # Maintain compatibility with Python 2.2
     True, False = 1, 0
     def bool(val):
         return not not val


-- 
Recently using MacOSX.......



More information about the Spambayes mailing list