diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 7889be9640..be34766f07 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -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 #---------------------------------------------------------------------- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index f2fe70f69e..118f419230 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -141,7 +141,7 @@ bool wxPyApp::OnInitGui() { // wxPyBeginBlockThreads(); *** only called from within __wxStart so we already have the GIL if (wxPyCBH_findCallback(m_myInst, "OnInitGui")) rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); - // wxPyEndBlockThreads(); + // wxPyEndBlockThreads(); *** return rval; } @@ -2225,8 +2225,8 @@ bool wxColour_helper(PyObject* source, wxColour** obj) { return TRUE; } // otherwise a string is expected - else if (PyString_Check(source)) { - wxString spec(PyString_AS_STRING(source), *wxConvCurrent); + else if (PyString_Check(source) || PyUnicode_Check(source)) { + wxString spec = Py2wxString(source); if (spec.GetChar(0) == '#' && spec.Length() == 7) { // It's #RRGGBB long red, green, blue; red = green = blue = 0; diff --git a/wxPython/src/utils.i b/wxPython/src/utils.i index 9b19149c5f..b40a1044a7 100644 --- a/wxPython/src/utils.i +++ b/wxPython/src/utils.i @@ -772,7 +772,7 @@ public: return self.__sub__DT(other) if isinstance(other, wxTimeSpanPtr): return self.__sub__TS(other) - if isinstnace(other, wxDateSpanPtr): + if isinstance(other, wxDateSpanPtr): return self.__sub__DS(other) raise TypeError, 'Invalid r.h.s. type for __sub__' "