Re: error in quixote.ptl.cimport

Titus Brown <[email protected]>
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
-> I'm upgrading an old app from Quixote 1.x to Quixote 2.3, and I ran into
-> an interesting problem: even though 'quixote.html.html_quote' no longer
-> exists in Quixote 2.3, when using the 'cimport' PTL module you can
-> import it.

Judicious placement of printfs throughout the code identified the
problem.  Here's the fix:

(the diff is attached as a file, too.)

*** cimport.c	2005-03-16 06:12:28.000000000 -0800
--- cimport.c.new	2005-10-24 09:50:34.000000000 -0700
***************
*** 321,327 ****
  
  		m = call_find_load(fullname, subname, path);
  
! 		if (m != NULL && mod != Py_None) {
  			if (PyObject_SetAttrString(mod, subname, m) < 0) {
  				Py_DECREF(m);
  				m = NULL;
--- 321,327 ----
  
  		m = call_find_load(fullname, subname, path);
  
! 		if (m != NULL && m != Py_None && mod != Py_None) {
  			if (PyObject_SetAttrString(mod, subname, m) < 0) {
  				Py_DECREF(m);
---  				m = NULL;

This fix makes sense to me & it works in my app as well as all three
Quixote demos.

cheers,
--titus

_______________________________________________
Quixote-users mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/quixote-users
cimport.diff (text/plain, 542 B)
*** cimport.c	2005-03-16 06:12:28.000000000 -0800
--- cimport.c.new	2005-10-24 09:50:34.000000000 -0700
***************
*** 321,327 ****
  
  		m = call_find_load(fullname, subname, path);
  
! 		if (m != NULL && mod != Py_None) {
  			if (PyObject_SetAttrString(mod, subname, m) < 0) {
  				Py_DECREF(m);
  				m = NULL;
--- 321,327 ----
  
  		m = call_find_load(fullname, subname, path);
  
! 		if (m != NULL && m != Py_None && mod != Py_None) {
  			if (PyObject_SetAttrString(mod, subname, m) < 0) {
  				Py_DECREF(m);
  				m = NULL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.