Skip to content

Commit

Permalink
fix *_repr() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka committed Nov 4, 2013
1 parent 5da4253 commit 2fa2765
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-11-04 Jiri Popelka <[email protected]>

* Python3 compatibility

2013-07-31 Jiri Popelka <[email protected]>

* cupsconnection.c (PyObject_from_attr_value): Fix getting of booleans.
Expand Down
8 changes: 4 additions & 4 deletions cupsconnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ Connection_repr (Connection *self)
snprintf (buffer, 256, "<cups.Connection object for %s at %p>",
self->host, self);
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat (buffer);
return PyUnicode_FromString (buffer);
#else
return PyBytes_FromFormat (buffer);
return PyBytes_FromString (buffer);
#endif
}

Expand Down Expand Up @@ -5491,9 +5491,9 @@ Dest_repr (Dest *self)
self->instance ? self->instance : "",
self->is_default ? " (default)" : "");
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat (buffer);
return PyUnicode_FromString (buffer);
#else
return PyBytes_FromFormat (buffer);
return PyBytes_FromString (buffer);
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions cupsipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ IPPAttribute_repr (IPPAttribute *self)
values ? ": " : "",
values ? values : "");
#if PY_MAJOR_VERSION >= 3
ret = PyUnicode_FromFormat (buffer);
ret = PyUnicode_FromString (buffer);
#else
ret = PyBytes_FromFormat (buffer);
ret = PyBytes_FromString (buffer);
#endif

free (values);
Expand Down
12 changes: 6 additions & 6 deletions cupsppd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,9 @@ Option_repr (Option *self)
snprintf (buffer, 256, "<cups.Option %s=%s>",
option->keyword, option->defchoice);
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat (buffer);
return PyUnicode_FromString (buffer);
#else
return PyBytes_FromFormat (buffer);
return PyBytes_FromString (buffer);
#endif
}

Expand Down Expand Up @@ -1399,9 +1399,9 @@ Group_repr (Group *self)
char buffer[256];
snprintf (buffer, 256, "<cups.Group %s>", group->name);
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat (buffer);
return PyUnicode_FromString (buffer);
#else
return PyBytes_FromFormat (buffer);
return PyBytes_FromString (buffer);
#endif
}

Expand Down Expand Up @@ -1747,9 +1747,9 @@ Attribute_repr (Attribute *self)
attribute->spec[0] != '\0' ? " ": "",
attribute->spec);
#if PY_MAJOR_VERSION >= 3
return PyUnicode_FromFormat (buffer);
return PyUnicode_FromString (buffer);
#else
return PyBytes_FromFormat (buffer);
return PyBytes_FromString (buffer);
#endif
}

Expand Down

0 comments on commit 2fa2765

Please sign in to comment.