Skip to content

Commit

Permalink
Merge pull request #773 from t184256/python3.10-ci
Browse files Browse the repository at this point in the history
support/test Python 3.10
  • Loading branch information
tomato42 committed Sep 1, 2021
2 parents 21fd652 + f08c132 commit a770342
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: py3.9
os: ubuntu-latest
python-version: 3.9
- name: py3.10
os: ubuntu-latest
python-version: '3.10.0-rc.1'
# also test with extraction tooling installed
- name: py2.6 with extract
os: ubuntu-latest
Expand Down Expand Up @@ -78,6 +81,10 @@ jobs:
os: ubuntu-latest
python-version: 3.9
opt-deps: ['extract']
- name: py3.10 with extract
os: ubuntu-latest
python-version: '3.10.0-rc.1'
opt-deps: ['extract']
# also test with just analysis tooling installed
- name: py3.6 with analysis
os: ubuntu-18.04
Expand All @@ -95,6 +102,10 @@ jobs:
os: ubuntu-latest
python-version: 3.9
opt-deps: ['analysis']
- name: py3.10 with analysis
os: ubuntu-latest
python-version: '3.10.0-rc.1'
opt-deps: ['analysis']
# and with both extract and analysis
- name: py3.6 with extract and analysis
os: ubuntu-18.04
Expand All @@ -111,6 +122,10 @@ jobs:
- name: py3.9 with extract and analysis
os: ubuntu-latest
python-version: 3.9
opt-deps: ['extract', 'analysis']
- name: py3.10 with extract and analysis
os: ubuntu-latest
python-version: '3.10.0-rc.1'
# note: codeclimate can be specified in only one environment
opt-deps: ['extract', 'analysis', 'codeclimate']
steps:
Expand Down Expand Up @@ -195,8 +210,11 @@ jobs:
if: ${{ !matrix.container }}
run: sudo apt-get install -y libmpfr-dev libmpc-dev libgmp-dev
- name: Install gmpy2
if: ${{ !matrix.container }}
if: ${{ !matrix.container && matrix.python-version != '3.10.0-rc.1' }}
run: pip install gmpy2
- name: Install gmpy2 2.1.0b6 (3.10)
if: ${{ !matrix.container && matrix.python-version == '3.10.0-rc.1' }}
run: pip install git+https://github.com/aleaxit/gmpy@gmpy2-2.1.0b6
- name: Install M2Crypto dependencies
if: ${{ !matrix.container }}
run: sudo apt-get install -y swig libssl-dev
Expand Down Expand Up @@ -325,6 +343,8 @@ jobs:
# https://github.com/python/cpython/blob/2c050e52f1ccf5db03819e4ed70690521d67e9fa/Lib/http/server.py#L253
if [[ $PYTHON_VERSION == '2.7' || $PYTHON_VERSION == '3.4' || $PYTHON_VERSION == '3.5' || $PYTHON_VERSION == '3.6' || $PYTHON_VERSION == '3.7' || $PYTHON_VERSION == '3.8' ]]; then
export REPLY_SIZE=1850
elif [[ $PYTHON_VERSION == '3.10.0-rc.1' ]]; then
export REPLY_SIZE=1853 # Server: SimpleHTTP/0.6 Python/3.10.0rc1
elif [[ $PYTHON_VERSION == 'nightly' ]]; then
export REPLY_SIZE=1852 # Server: SimpleHTTP/0.6 Python/3.10.0a0
else
Expand Down
12 changes: 10 additions & 2 deletions tlsfuzzer/expect.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""Parsing and processing of received TLS messages"""
from __future__ import print_function

import collections
import itertools
from functools import partial
import sys
Expand Down Expand Up @@ -40,6 +39,15 @@
from .helpers import ECDSA_SIG_TLS1_3_ALL
from .tree import TreeNode

# pylint: disable=import-error,no-name-in-module
# pylint: disable=bad-option-value,deprecated-class
if sys.version_info >= (3, 3):
from collections.abc import Iterable
else:
from collections import Iterable
# pylint: enable=bad-option-value,deprecated-class
# pylint: enable=import-error,no-name-in-module


class Expect(TreeNode):
"""Base class for objects handling message readers"""
Expand Down Expand Up @@ -1818,7 +1826,7 @@ def process(self, state, msg):
self.level)
if self.description is not None:
# allow for multiple choice for description
if not isinstance(self.description, collections.Iterable):
if not isinstance(self.description, Iterable):
self.description = tuple([self.description])

if alert.description not in self.description:
Expand Down

0 comments on commit a770342

Please sign in to comment.