!15 Upgrade to 3.0.1
From: @wu-leilei Reviewed-by: @lyn1001 Signed-off-by: @lyn1001
This commit is contained in:
commit
6063e83efd
@ -1,94 +0,0 @@
|
||||
From f3b1b44bf3d2d5927004fa1c2fcf1ab2def816b9 Mon Sep 17 00:00:00 2001
|
||||
From: Anthony Sottile <asottile@umich.edu>
|
||||
Date: Thu, 20 May 2021 07:23:19 -0700
|
||||
Subject: [PATCH] fix syntax error offsets for python 3.10 (#635)
|
||||
|
||||
---
|
||||
.github/workflows/test.yml | 2 +-
|
||||
pyflakes/test/test_api.py | 43 +++++++++++++++++++++++++-------------
|
||||
tox.ini | 2 +-
|
||||
3 files changed, 30 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py
|
||||
index d379b3b..2c1cf19 100644
|
||||
--- a/pyflakes/test/test_api.py
|
||||
+++ b/pyflakes/test/test_api.py
|
||||
@@ -441,7 +441,7 @@ def baz():
|
||||
evaluate(source)
|
||||
except SyntaxError:
|
||||
e = sys.exc_info()[1]
|
||||
- if not PYPY:
|
||||
+ if not PYPY and sys.version_info < (3, 10):
|
||||
self.assertTrue(e.text.count('\n') > 1)
|
||||
else:
|
||||
self.fail()
|
||||
@@ -449,10 +449,17 @@ def baz():
|
||||
with self.makeTempFile(source) as sourcePath:
|
||||
if PYPY:
|
||||
message = 'end of file (EOF) while scanning triple-quoted string literal'
|
||||
+ elif sys.version_info >= (3, 10):
|
||||
+ message = 'unterminated triple-quoted string literal (detected at line 8)' # noqa: E501
|
||||
else:
|
||||
message = 'invalid syntax'
|
||||
|
||||
- column = 8 if sys.version_info >= (3, 8) else 11
|
||||
+ if sys.version_info >= (3, 10):
|
||||
+ column = 12
|
||||
+ elif sys.version_info >= (3, 8):
|
||||
+ column = 8
|
||||
+ else:
|
||||
+ column = 11
|
||||
self.assertHasErrors(
|
||||
sourcePath,
|
||||
["""\
|
||||
@@ -468,21 +475,25 @@ def baz():
|
||||
"""
|
||||
with self.makeTempFile("def foo(") as sourcePath:
|
||||
if PYPY:
|
||||
- result = """\
|
||||
-%s:1:7: parenthesis is never closed
|
||||
-def foo(
|
||||
- ^
|
||||
-""" % (sourcePath,)
|
||||
+ msg = 'parenthesis is never closed'
|
||||
+ elif sys.version_info >= (3, 10):
|
||||
+ msg = "'(' was never closed"
|
||||
else:
|
||||
- result = """\
|
||||
-%s:1:9: unexpected EOF while parsing
|
||||
-def foo(
|
||||
- ^
|
||||
-""" % (sourcePath,)
|
||||
+ msg = 'unexpected EOF while parsing'
|
||||
|
||||
- self.assertHasErrors(
|
||||
- sourcePath,
|
||||
- [result])
|
||||
+ if PYPY:
|
||||
+ column = 7
|
||||
+ elif sys.version_info >= (3, 10):
|
||||
+ column = 8
|
||||
+ else:
|
||||
+ column = 9
|
||||
+
|
||||
+ spaces = ' ' * (column - 1)
|
||||
+ expected = '{}:1:{}: {}\ndef foo(\n{}^\n'.format(
|
||||
+ sourcePath, column, msg, spaces
|
||||
+ )
|
||||
+
|
||||
+ self.assertHasErrors(sourcePath, [expected])
|
||||
|
||||
def test_eofSyntaxErrorWithTab(self):
|
||||
"""
|
||||
@@ -515,6 +526,8 @@ def foo(bar=baz, bax):
|
||||
if ERROR_HAS_LAST_LINE:
|
||||
if PYPY:
|
||||
column = 7
|
||||
+ elif sys.version_info >= (3, 10):
|
||||
+ column = 18
|
||||
elif sys.version_info >= (3, 9):
|
||||
column = 21
|
||||
elif sys.version_info >= (3, 8):
|
||||
--
|
||||
2.27.0
|
||||
|
||||
Binary file not shown.
BIN
pyflakes-3.0.1.tar.gz
Normal file
BIN
pyflakes-3.0.1.tar.gz
Normal file
Binary file not shown.
@ -2,14 +2,13 @@
|
||||
%global common_desc \
|
||||
Pyflakes A simple program which checks Python source files for errors.Pyflakes
|
||||
Name: python-pyflakes
|
||||
Version: 2.3.1
|
||||
Release: 2
|
||||
Version: 3.0.1
|
||||
Release: 1
|
||||
Summary: passive checker of Python programs
|
||||
License: MIT
|
||||
URL: https://github.com/PyCQA/pyflakes
|
||||
Source0: https://files.pythonhosted.org/packages/a8/0f/0dc480da9162749bf629dca76570972dd9cce5bedc60196a3c912875c87d/pyflakes-2.3.1.tar.gz
|
||||
Source0: https://files.pythonhosted.org/packages/f2/51/506ddcfab10d708e8460554cc1cf37c727a6a2cccbad8dfe57766cfce33c/pyflakes-3.0.1.tar.gz
|
||||
|
||||
Patch0000: fix-syntax-error-offsets-for-python-3.10-635.patch
|
||||
|
||||
BuildArch: noarch
|
||||
%description
|
||||
@ -34,7 +33,7 @@ Provides: python3-pyflakes-doc
|
||||
%{common_desc}
|
||||
|
||||
%prep
|
||||
%autosetup -n pyflakes-2.3.1 -p1
|
||||
%autosetup -n pyflakes-3.0.1 -p1
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
@ -79,6 +78,9 @@ mv %{buildroot}/doclist.lst .
|
||||
%{_docdir}/*
|
||||
|
||||
%changelog
|
||||
* Fri Apr 14 2023 wulei <wu_lei@hoperun.com> - 3.0.1-1
|
||||
- Upgrade package to version 3.0.1
|
||||
|
||||
* Wed Mar 30 2022 xu_ping <xuping33@huawei.com> - 2.3.1-2
|
||||
- Fix syntax error offsets for python 3.10
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user