mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
[3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215)
This commit is contained in:
parent
8e837373ed
commit
d678ee7719
24 changed files with 150 additions and 120 deletions
5
.github/CODEOWNERS
vendored
5
.github/CODEOWNERS
vendored
|
@ -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
22
.github/workflows/lint.yml
vendored
Normal 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
7
.pre-commit-config.yaml
Normal 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]
|
|
@ -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()
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue