summaryrefslogtreecommitdiff
path: root/src/easy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/easy.c')
-rw-r--r--src/easy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/easy.c b/src/easy.c
index 05f24c7..2b1e296 100644
--- a/src/easy.c
+++ b/src/easy.c
@@ -276,13 +276,14 @@ static inline PyObject* my_Py_XNewRef(PyObject *obj)
PYCURL_INTERNAL CurlObject *
do_curl_duphandle(CurlObject *self)
{
+ PyTypeObject *subtype;
CurlObject *dup;
int res;
int *ptr;
/* Allocate python curl object */
- /* TODO: allocate subtype instead of Curl_Type */
- dup = (CurlObject *) p_Curl_Type->tp_alloc(p_Curl_Type, 0);
+ subtype = Py_TYPE(self);
+ dup = (CurlObject *) subtype->tp_alloc(subtype, 0);
if (dup == NULL)
return NULL;