public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/plplot] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Wed, 29 Jul 2026 03:06:39 GMT	[thread overview]
Message-ID: <178529439908.1.8819699002562119203.rpms-plplot-a28bbddc314b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/plplot
Branch : rawhide
Commit : a28bbddc314bb3a7026beed5d8296f32884639e8
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +62/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/plplot/c/a28bbddc314bb3a7026beed5d8296f32884639e8?branch=rawhide

Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility

---
diff --git a/plplot-swig45.patch b/plplot-swig45.patch
new file mode 100644
index 0000000..69007e3
--- /dev/null
+++ b/plplot-swig45.patch
@@ -0,0 +1,58 @@
+diff -up plplot-5.15.0/bindings/python/plplotc.i.swig45 plplot-5.15.0/bindings/python/plplotc.i
+--- plplot-5.15.0/bindings/python/plplotc.i.swig45	2026-07-28 10:23:36.392606837 +0200
++++ plplot-5.15.0/bindings/python/plplotc.i	2026-07-28 10:23:36.396606919 +0200
+@@ -756,7 +756,7 @@ typedef PLINT          PLBOOL;
+     $1 = buff;
+ }
+ %typemap( argout ) char *OUTPUT {
+-    PyObject *o = PyString_FromString( $1 );
++    PyObject *o = PyUnicode_FromString( $1 );
+     $result = SWIG_AppendOutput( $result, o );
+ }
+ 
+@@ -1143,10 +1143,10 @@ typedef void ( *label_func )( PLINT, PLF
+                 fprintf( stderr, "label callback failed with 3 arguments\n" );
+                 PyErr_SetString( PyExc_RuntimeError, "label callback must take 3 arguments." );
+             }
+-            else if ( PyString_Check( result ) )
++            else if ( PyBytes_Check( result ) )
+             {
+                 // should I test the type here?
+-                pystring = PyString_AsString( result );
++                pystring = PyBytes_AsString( result );
+                 strncpy( string, pystring, len );
+             }
+             else if ( PyUnicode_Check( result ) )
+@@ -1266,7 +1266,7 @@ typedef void ( *label_func )( PLINT, PLF
+             }
+             else
+             {
+-                str = PyString_AsString( rep );
++                str = PyBytes_AsString( rep );
+             }
+             if ( strstr( str, "function pltr0" ) != 0 )
+             {
+@@ -1587,9 +1587,9 @@ typedef void ( *label_func )( PLINT, PLF
+     {
+         $1[i] = NULL;
+         elt   = PySequence_Fast_GET_ITEM( $input, i );
+-        if ( PyString_Check( elt ) )
++        if ( PyBytes_Check( elt ) )
+         {
+-            $1[i] = PyString_AsString( elt );
++            $1[i] = PyBytes_AsString( elt );
+         }
+         else if ( PyUnicode_Check( elt ) )
+         {
+@@ -1626,9 +1626,9 @@ typedef void ( *label_func )( PLINT, PLF
+     for ( i = 0; i < tmp; i++ )
+     {
+         PyObject *s = PyList_GetItem( $input, i );
+-        if ( PyString_Check( s ) )
++        if ( PyBytes_Check( s ) )
+         {
+-            $2[i] = PyString_AsString( s );
++            $2[i] = PyBytes_AsString( s );
+         }
+         else if ( PyUnicode_Check( s ) )
+         {

diff --git a/plplot.spec b/plplot.spec
index 7dc87b1..a88ea59 100644
--- a/plplot.spec
+++ b/plplot.spec
@@ -98,6 +98,9 @@ Patch14:        plplot-5.15.0-swig-4.3.patch
 # Fix for SWIG 4.4.0
 # https://sourceforge.net/p/plplot/support-requests/56/
 Patch15:        https://sourceforge.net/p/plplot/support-requests/_discuss/thread/bd326c8bff/fec5/attachment/plplot-5.15.0-swig-4.4.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch16:        plplot-swig45.patch
 
 
 BuildRequires:  cmake >= 3.13.2
@@ -429,6 +432,7 @@ Requires:       wxGTK-devel%{?_isa}
 %patch -P13 -p1 -b .ocamlmklib
 %patch -P14 -p1
 %patch -P15 -p1
+%patch -P16 -p1
 # Use cmake FindLua
 rm cmake/modules/FindLua.cmake
 

                 reply	other threads:[~2026-07-29  3:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178529439908.1.8819699002562119203.rpms-plplot-a28bbddc314b@fedoraproject.org \
    --to=jplesnik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox