一个类型怎么可能与其自身不兼容?

2024-04-26 17:26:45 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的django应用程序(运行在Red Hat上的django 1.6.0、python 2.7.5)中,我的数据库驱动程序看到ctypes错误:

TypeError: incompatible types, LP_c_int instance instead of LP_c_int instance

代码如下:

    is_null = value is None
    param.value.is_null = pointer(c_int(is_null)) <-- error occurs on this line

我不太熟悉ctypes(我继承了这段代码),但从表面上看,这个错误消息没有任何意义。这个代码已经运行了很多年了,但是我现在看到这个错误到处都是。我是不是做了什么明显的错误?在

以下是来自Ilja Everilä的评论:

^{pr2}$

Tags: djangoinstance代码数据库应用程序isvaluehat