Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline the validate() function #119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ jobs:
max-parallel: 5
matrix:
python-version:
- 2.7
- 3.6
- 3.7
- 3.8
- pypy2
- pypy3

steps:
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ other hand, the following are all very welcome:
tox
```

But note that: (1) this will print slightly misleading coverage
But note that: (1) this might print slightly misleading coverage
statistics, because it only shows coverage for individual python
versions, and there are some lines that are only executed on python
2 or only executed on python 3, and (2) the full test suite will
versions, and there might be some lines that are only executed on some
python versions or implementations, and (2) the full test suite will
automatically get run when you submit a pull request, so you don't
need to worry too much about tracking down a version of cpython 3.3
or whatever just to run the tests.
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ library.
It has a test suite with 100.0% coverage for both statements and
branches.

Currently it supports Python 3 (testing on 3.5-3.8), Python 2.7, and PyPy.
Currently it supports Python 3 (testing on 3.5-3.8) and PyPy 3.
The last Python 2-compatible version was h11 0.11.x.
(Originally it had a Cython wrapper for `http-parser
<https://github.com/nodejs/http-parser>`_ and a beautiful nested state
machine implemented with ``yield from`` to postprocess the output. But
Expand Down
2 changes: 1 addition & 1 deletion bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
"pythons": ["2.7", "3.5", "pypy"],
"pythons": ["3.8", "pypy3"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
Expand Down
4 changes: 3 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ whatever. But h11 makes it much easier to implement something like
Vital statistics
----------------

* Requirements: Python 2.7 or Python 3.5+ (PyPy works great)
* Requirements: Python 3.5+ (PyPy works great)

The last Python 2-compatible version was h11 0.11.x.

* Install: ``pip install h11``

Expand Down
7 changes: 1 addition & 6 deletions fuzz/afl-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

import h11

if sys.version_info[0] >= 3:
in_file = sys.stdin.detach()
else:
in_file = sys.stdin


def process_all(c):
while True:
Expand All @@ -26,7 +21,7 @@ def process_all(c):

afl.init()

data = in_file.read()
data = sys.stdin.detach().read()

# one big chunk
server1 = h11.Connection(h11.SERVER)
Expand Down
2 changes: 1 addition & 1 deletion h11/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _body_framing(request_method, event):
################################################################


class Connection(object):
class Connection:
"""An object encapsulating the state of an HTTP connection.

Args:
Expand Down
Loading