diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-01-25 15:48:50 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-01-25 15:48:50 +0100 |
commit | 261c5b8a2aada7fb88e95828293d2d0a90144d84 (patch) | |
tree | 80a195d53400d2b80ee98e27986747e3e80927bf /ffi/lang/python/tests | |
parent | 2a162dcaf165e59b72a24825bdc2e1c627979d23 (diff) |
python: Only use features found in Debian Stable (Debian 9)
- CDefError is not exposed as cffi.error.CDefError, but as
cffi.api.CDefError in python3-cffi 1.9.1-2. This change is
forwards compatible with python3-cffi 1.11.5-3 (from Debian
Testing).
- enum.auto is only available in Python v3.6. Albeit uglier,
manually assigning values works in Python v3.5 (and later).
Diffstat (limited to 'ffi/lang/python/tests')
-rw-r--r-- | ffi/lang/python/tests/test_packet_parser.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ffi/lang/python/tests/test_packet_parser.py b/ffi/lang/python/tests/test_packet_parser.py index 1c134f6f..de126bc3 100644 --- a/ffi/lang/python/tests/test_packet_parser.py +++ b/ffi/lang/python/tests/test_packet_parser.py @@ -1,4 +1,4 @@ -from enum import Enum, auto +from enum import Enum from sequoia.core import Context, NetworkPolicy from sequoia.openpgp import Tag, PacketParser @@ -11,10 +11,13 @@ def test_decryption(): ephemeral=True) class State(Enum): - Start = auto() - Decrypted = auto() - Deciphered = auto() - Done = auto() + # XXX: In Python 3.6, we can use enum.auto() to assign values. + # But we want to support Debian 9, which uses Python 3.5, as + # long as it is Debian stable. + Start = 1 + Decrypted = 2 + Deciphered = 3 + Done = 4 state = State.Start algo, key = None, None |