Gave up on generating a warning upon the use of the old true/false or

TRUE/FALSE values.

Fixed the typemap that converts strings to wxColours to also accept
unicode.

Typo fixed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-03-19 03:45:44 +00:00
parent 80977b9444
commit 375c124f0d
3 changed files with 7 additions and 21 deletions

View File

@@ -632,23 +632,9 @@ except NameError:
True = 1==1
False = 1==0
class _DeprecatedNonBool:
def __init__(self, val, txt):
self.__val = val
self.__txt = txt
def __int__(self):
import warnings
warnings.warn("Use Python's %s instead" % self.__txt, DeprecationWarning, 3)
return self.__val
def __nonzero__(self):
return self.__int__()
def __repr__(self):
if self.__val: text = "True"
else: text = "False"
return "_DeprecatedNonBool: %s" % text
TRUE = true = _DeprecatedNonBool(True, 'True')
FALSE = false = _DeprecatedNonBool(False, 'False')
# Backwards compaatible
TRUE = true = True
FALSE = false = False
#----------------------------------------------------------------------