Home GnuPG
Diffusion GPGME 70a3be27a509

python: Handle slight differences between Python 2 and 3.
70a3be27a509Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

python: Handle slight differences between Python 2 and 3.

* lang/python/helpers.c (pyDataWriteCb): Handle Python integers being
returned on Python 2.
(pyDataSeekCb): Likewise.
* lang/python/pyme/core.py (Data.__init__): Fix testing for string
argument.
(Data.new_from_filepart): Likewise.
* lang/python/pyme/util.py (is_a_string): New function.
* lang/python/tests/t-encrypt-large.py (read_cb): Force evaluation of
generator.
* lang/python/tests/t-idiomatic.py: Partly skip test on Python 2.
* lang/python/tests/t-verify.py (check_result): Here, the difference
between 2 and 3 really matters.  We cannot change the char *
conversion in Python 2 without breaking all existing applications, and
using bytestrings in Python 3 would be very inconvenient.
  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Sep 13 2016, 10:44 AM
Parents
rM4abff7d750a1: python: Fix types and error handling.
Branches
Unknown
Tags
Unknown

Event Timeline

Justus Winter <justus@g10code.com> committed rM70a3be27a509: python: Handle slight differences between Python 2 and 3. (authored by Justus Winter <justus@g10code.com>).Sep 13 2016, 1:29 PM