Skip to content

Commit

Permalink
Fix systemd.daemon.is_fifo under Python 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Jajcus committed Aug 7, 2015
1 parent c8c1c22 commit 769e691
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions python-systemd-py3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff -dur systemd-219.orig/src/python-systemd/_daemon.c systemd-219/src/python-systemd/_daemon.c
--- systemd-219.orig/src/python-systemd/_daemon.c 2015-02-03 02:00:06.000000000 +0100
+++ systemd-219/src/python-systemd/_daemon.c 2015-08-07 12:32:34.000000000 +0200
@@ -143,9 +143,12 @@
const char *path = NULL;

#if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 1
+ _cleanup_Py_DECREF_ PyObject *_path = NULL;
if (!PyArg_ParseTuple(args, "i|O&:_is_fifo",
- &fd, Unicode_FSConverter, &path))
+ &fd, Unicode_FSConverter, &_path))
return NULL;
+ if (_path)
+ path = PyBytes_AsString(_path);
#else
if (!PyArg_ParseTuple(args, "i|z:_is_fifo", &fd, &path))
return NULL;
@@ -171,9 +174,12 @@
const char *path = NULL;

#if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 1
+ _cleanup_Py_DECREF_ PyObject *_path = NULL;
if (!PyArg_ParseTuple(args, "i|O&:_is_mq",
- &fd, Unicode_FSConverter, &path))
+ &fd, Unicode_FSConverter, &_path))
return NULL;
+ if (_path)
+ path = PyBytes_AsString(_path);
#else
if (!PyArg_ParseTuple(args, "i|z:_is_mq", &fd, &path))
return NULL;
2 changes: 2 additions & 0 deletions systemd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Patch19: uids_gids.patch
Patch20: sysv-symlinks-warning.patch
Patch21: no-configurable-runlevels.patch
Patch22: timesync_in_vm.patch
Patch23: python-systemd-py3.patch
URL: http://www.freedesktop.org/wiki/Software/systemd
BuildRequires: acl-devel
BuildRequires: attr-devel
Expand Down Expand Up @@ -698,6 +699,7 @@ Uzupełnianie parametrów w zsh dla poleceń udev.
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
cp -p %{SOURCE2} src/systemd_booted.c

%build
Expand Down

0 comments on commit 769e691

Please sign in to comment.