{"id":2227560,"url":"http://patchwork.ozlabs.org/api/patches/2227560/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260423222125.29097-8-vfazio@gmail.com/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/projects/42/?format=json","name":"Linux GPIO development","link_name":"linux-gpio","list_id":"linux-gpio.vger.kernel.org","list_email":"linux-gpio@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260423222125.29097-8-vfazio@gmail.com>","list_archive_url":null,"date":"2026-04-23T22:21:24","name":"[libgpiod,v2,7/8] bindings: python: tests: migrate the system module to multi-phase init","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f12b9b1dcca8eee2f6ca2c7ae3477e1fc3fc9bf5","submitter":{"id":78694,"url":"http://patchwork.ozlabs.org/api/people/78694/?format=json","name":"Vincent Fazio","email":"vfazio@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260423222125.29097-8-vfazio@gmail.com/mbox/","series":[{"id":501257,"url":"http://patchwork.ozlabs.org/api/series/501257/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=501257","date":"2026-04-23T22:21:18","name":"bindings: python: modernize C extensions","version":2,"mbox":"http://patchwork.ozlabs.org/series/501257/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2227560/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2227560/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-gpio+bounces-35439-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-gpio@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=BMtuXWGU;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35439-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"BMtuXWGU\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.160.50","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1rDT4Z5gz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 08:22:01 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 61F68301ECD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 22:21:56 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 359AD37C916;\n\tThu, 23 Apr 2026 22:21:56 +0000 (UTC)","from mail-oa1-f50.google.com (mail-oa1-f50.google.com\n [209.85.160.50])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id C8EB02EC081\n\tfor <linux-gpio@vger.kernel.org>; Thu, 23 Apr 2026 22:21:54 +0000 (UTC)","by mail-oa1-f50.google.com with SMTP id\n 586e51a60fabf-415e568a7ecso3090103fac.0\n        for <linux-gpio@vger.kernel.org>;\n Thu, 23 Apr 2026 15:21:54 -0700 (PDT)","from Zephyrus.localdomain ([131.93.209.211])\n        by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-42b930afa63sm17784598fac.5.2026.04.23.15.21.52\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 23 Apr 2026 15:21:53 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776982916; cv=none;\n b=vEWw6JS0+3FFHo+b0QshXpiuBUxdoPegINXI5s6qrs599Vm2zUO+wXqnxA4DN4IXVxNG4wePssTdxiphLRdvEss9wkQgJg4x4dJO4lX0peM/RHM7zkvPasIi6Q1qq9mNFwV5s7/FpKs2NFw96l5Hm72epQYHbMI6KjKuC/dMlfY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776982916; c=relaxed/simple;\n\tbh=FabEycj9tvaV4lyDSd5rguTIAyQ+tCco890ClR8kXVo=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=fwb3OhoJmFw6r7fsQ8Vm33ht2QalB1d5WqjA0kTHnNLPbyBfoOmpw09jeQ6RP4xs+LsNcFgPxdRFkevCBLedwxGdsanwbgqc2jDb/ZY+v0gW1Pzb/qZ9bUT8ApU9VpXsC7VzsisgE917YiCnB7tU6Efq4R5jeM5Ygza3B89sl7E=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=BMtuXWGU; arc=none smtp.client-ip=209.85.160.50","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776982913; x=1777587713;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=NJoY4vcc8yBC6LVSkoR5wl1wWlEyFdnB0jaeRhoN6mg=;\n        b=BMtuXWGUnAM6go7Z+sFOoOQ3sQRzLSKksU+QKAetO3sin0JN6y4O+/j5+8l0fxTwoL\n         NtdnNe614ob+r32MOVKu7oDy4wT5OJUW6DSoSwRLOReIkrY1+PBNdWIeueQnMPi5qyeT\n         pMi+0KuDLAWrx1CjmpJqQINjuyK3gKFtB6Kcs8BRuE5y9gyUWE8UkyFTIrGFpZXhUMiY\n         qq+Mu4zhAbAuJbYf67OR3GcUwljzBVmiZfHNZvIdlnaYWA/FCSKPft4686cHOozuLi8V\n         O5oU2vxetsBRagD1yiPDa4ASHRKH1Quc570qEstGpt0uaFIB2YPtVK1+NUFNj4c6Zjx2\n         HJHg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776982913; x=1777587713;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=NJoY4vcc8yBC6LVSkoR5wl1wWlEyFdnB0jaeRhoN6mg=;\n        b=FkHtdE3xW7KGHYl05RTtH7aD0hACX7XgQQ1W1WeWovk6Pz0bN4L19HhE9eHRCov3AN\n         raTu+0pyOtxcX5YNgX79b5La+dsbmv42+WAUQ3nniDi0OAcVvLBnhD4MATPxePofKLuN\n         epZMeVrbvQyz9FVpTqLSMHgqVHa1bWtPr5F1aLlAAhgnbb3K230Y7HV4+jmhtuQKBm7h\n         zpW/eqxx8ty7xtJ6EHP/yVEyr+0A+m7omL3muWmslrfIgcTpa5JDbauR506NhUsybhCa\n         CYSauUjiteIAI3yNmcqnxDr5RZwdc/Tp2U4xmjwXhmSiMQyvqdkdHui3ulWNl1Ebxh34\n         64Lg==","X-Gm-Message-State":"AOJu0YyuTm7I2fMDdoeuD8i551DOPkqg42/70ER0upX8tpZq+SoHe/fU\n\tEL8ryfkFpTHE2QZvdJOemrYJecgPnY8eHQuDbkpQSb5PS+M/h3Xqnz5PPo94GA==","X-Gm-Gg":"AeBDieuoAKovzn6pTL3uRvnZxJOQlKlUKJ1XzPMWLipX6/bY7cFvbbHYIkG3TEV86XC\n\tloS1cqoaUzX7WWt3SVAqqnO12Nitj2rsCnGTUbGfy5W2H43dnsbjQpihQgmfpGYvulexxjiYNaS\n\tkAzRKFwVrsBLl0tFJztk0fhvy5V29YdcBWx98J+94/aNWWe3pz10zoCfFBE3OgKvuNfZIiRfq0R\n\tHotY+MGyRW4vvcQ0s9hg/fqlraOJSFxAiE2kudMaJRr4i3tUxjqpR4hmYtKmzLeA+PIv7Vfgx+G\n\tnCOoMXys/IuW5BcEIKBQwS+HGO4lR2DFC7cX6xFKbxrau7td864POx1fQVhK+23zqM4tOdAXZ5H\n\tlU8zexwT/pTaGS60vvwAxTVmdJr5CTzfd0RLFKqa5p6tup6gGk9hvUx437zdt6e4JHniJzAt3JC\n\t3qoFIL2oxh5+ncyvHU5lSDW4cm3sP0iaTv+it8YpnXKgr7K0Qlud6Ep/w5gdS+3veDMXiSH8nQ","X-Received":"by 2002:a05:6870:ac14:b0:417:533b:79ac with SMTP id\n 586e51a60fabf-42abf2aa0acmr17359332fac.9.1776982913520;\n        Thu, 23 Apr 2026 15:21:53 -0700 (PDT)","From":"Vincent Fazio <vfazio@gmail.com>","To":"linux-gpio@vger.kernel.org","Cc":"brgl@kernel.org,\n\tVincent Fazio <vfazio@gmail.com>","Subject":"[libgpiod][PATCH v2 7/8] bindings: python: tests: migrate the system\n module to multi-phase init","Date":"Thu, 23 Apr 2026 17:21:24 -0500","Message-ID":"<20260423222125.29097-8-vfazio@gmail.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260423222125.29097-1-vfazio@gmail.com>","References":"<20260423222125.29097-1-vfazio@gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-gpio@vger.kernel.org","List-Id":"<linux-gpio.vger.kernel.org>","List-Subscribe":"<mailto:linux-gpio+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-gpio+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Single-phase initialization has been classified as legacy within CPython\ndocumentation [0] with multi-phase being its successor [1].\n\nAs such, switch to the new methodology.\n\n[0]: https://docs.python.org/3/c-api/extension-modules.html#legacy-single-phase-initialization\n[1]: https://docs.python.org/3/c-api/extension-modules.html#multi-phase-initialization\n\nSigned-off-by: Vincent Fazio <vfazio@gmail.com>\n---\n bindings/python/tests/system/ext.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)","diff":"diff --git a/bindings/python/tests/system/ext.c b/bindings/python/tests/system/ext.c\nindex c982fa6..800648e 100644\n--- a/bindings/python/tests/system/ext.c\n+++ b/bindings/python/tests/system/ext.c\n@@ -67,13 +67,18 @@ static PyMethodDef module_methods[] = {\n \t{ }\n };\n \n+static struct PyModuleDef_Slot module_slots[] = {\n+\t{0, NULL},\n+};\n+\n static PyModuleDef module_def = {\n \tPyModuleDef_HEAD_INIT,\n \t.m_name = \"system._ext\",\n \t.m_methods = module_methods,\n+\t.m_slots = module_slots,\n };\n \n PyMODINIT_FUNC PyInit__ext(void)\n {\n-\treturn PyModule_Create(&module_def);\n+\treturn PyModuleDef_Init(&module_def);\n }\n","prefixes":["libgpiod","v2","7/8"]}