[3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215)

This commit is contained in:
Hugo van Kemenade 2023-08-22 12:57:31 +03:00 committed by GitHub
parent 8e837373ed
commit d678ee7719
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 150 additions and 120 deletions

5
.github/CODEOWNERS vendored
View file

@ -5,7 +5,10 @@
# https://git-scm.com/docs/gitignore#_pattern_format
# GitHub
.github/** @ezio-melotti
.github/** @ezio-melotti @hugovk
# pre-commit
.pre-commit-config.yaml @hugovk @AlexWaygood
# asyncio
**/*asyncio* @1st1 @asvetlov

22
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Lint
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0

7
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: trailing-whitespace
types_or: [c, python, rst]

View file

@ -8,7 +8,6 @@ import typing
from test import support
class TestIsInstanceExceptions(unittest.TestCase):
# Test to make sure that an AttributeError when accessing the instance's
# class's bases is masked. This was actually a bug in Python 2.2 and
@ -97,7 +96,7 @@ class TestIsInstanceExceptions(unittest.TestCase):
class D: pass
self.assertRaises(RuntimeError, isinstance, c, D)
# These tests are similar to above, but tickle certain code paths in
# issubclass() instead of isinstance() -- really PyObject_IsSubclass()
# vs. PyObject_IsInstance().
@ -147,7 +146,6 @@ class TestIsSubclassExceptions(unittest.TestCase):
self.assertRaises(TypeError, issubclass, B, C())
# meta classes for creating abstract classes and instances
class AbstractClass(object):
def __init__(self, bases):
@ -179,7 +177,7 @@ class Super:
class Child(Super):
pass
class TestIsInstanceIsSubclass(unittest.TestCase):
# Tests to ensure that isinstance and issubclass work on abstract
# classes and instances. Before the 2.2 release, TypeErrors were
@ -357,6 +355,6 @@ def blowstack(fxn, arg, compare_to):
tuple_arg = (tuple_arg,)
fxn(arg, tuple_arg)
if __name__ == '__main__':
unittest.main()

View file

@ -59,7 +59,7 @@ PyDoc_STRVAR(module_doc,
" I/O classes. open() uses the file's blksize (as obtained by os.stat) if\n"
" possible.\n"
);
/*
* The main open() function
@ -512,7 +512,7 @@ _io_open_code_impl(PyObject *module, PyObject *path)
{
return PyFile_OpenCodeObject(path);
}
/*
* Private helpers for the io module.
*/