Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1f6b69b7
Kaydet (Commit)
1f6b69b7
authored
Eki 17, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28409: regrtest: fix the parser of command line arguments.
üst
5493e472
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
regrtest.py
Lib/test/regrtest.py
+7
-4
test_regrtest.py
Lib/test/test_regrtest.py
+10
-0
NEWS
Misc/NEWS
+4
-2
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
1f6b69b7
...
@@ -325,9 +325,6 @@ def _create_parser():
...
@@ -325,9 +325,6 @@ def _create_parser():
group
.
add_argument
(
'-P'
,
'--pgo'
,
dest
=
'pgo'
,
action
=
'store_true'
,
group
.
add_argument
(
'-P'
,
'--pgo'
,
dest
=
'pgo'
,
action
=
'store_true'
,
help
=
'enable Profile Guided Optimization training'
)
help
=
'enable Profile Guided Optimization training'
)
parser
.
add_argument
(
'args'
,
nargs
=
'*'
,
help
=
argparse
.
SUPPRESS
)
return
parser
return
parser
def
relative_filename
(
string
):
def
relative_filename
(
string
):
...
@@ -373,7 +370,13 @@ def _parse_args(args, **kwargs):
...
@@ -373,7 +370,13 @@ def _parse_args(args, **kwargs):
ns
.
use_resources
=
[]
ns
.
use_resources
=
[]
parser
=
_create_parser
()
parser
=
_create_parser
()
parser
.
parse_args
(
args
=
args
,
namespace
=
ns
)
# Issue #14191: argparse doesn't support "intermixed" positional and
# optional arguments. Use parse_known_args() as workaround.
ns
.
args
=
parser
.
parse_known_args
(
args
=
args
,
namespace
=
ns
)[
1
]
for
arg
in
ns
.
args
:
if
arg
.
startswith
(
'-'
):
parser
.
error
(
"unrecognized arguments:
%
s"
%
arg
)
sys
.
exit
(
1
)
if
ns
.
single
and
ns
.
fromfile
:
if
ns
.
single
and
ns
.
fromfile
:
parser
.
error
(
"-s and -f don't go together!"
)
parser
.
error
(
"-s and -f don't go together!"
)
...
...
Lib/test/test_regrtest.py
Dosyayı görüntüle @
1f6b69b7
...
@@ -270,6 +270,16 @@ class ParseArgsTestCase(unittest.TestCase):
...
@@ -270,6 +270,16 @@ class ParseArgsTestCase(unittest.TestCase):
self
.
assertEqual
(
ns
.
verbose
,
0
)
self
.
assertEqual
(
ns
.
verbose
,
0
)
self
.
assertEqual
(
ns
.
args
,
[
'foo'
])
self
.
assertEqual
(
ns
.
args
,
[
'foo'
])
def
test_arg_option_arg
(
self
):
ns
=
regrtest
.
_parse_args
([
'test_unaryop'
,
'-v'
,
'test_binop'
])
self
.
assertEqual
(
ns
.
verbose
,
1
)
self
.
assertEqual
(
ns
.
args
,
[
'test_unaryop'
,
'test_binop'
])
def
test_unknown_option
(
self
):
self
.
checkError
([
'--unknown-option'
],
'unrecognized arguments: --unknown-option'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
1f6b69b7
...
@@ -376,11 +376,11 @@ Library
...
@@ -376,11 +376,11 @@ Library
- Issue #27759: Fix selectors incorrectly retain invalid file descriptors.
- Issue #27759: Fix selectors incorrectly retain invalid file descriptors.
Patch by Mark Williams.
Patch by Mark Williams.
- Issue #28368: Refuse monitoring processes if the child watcher has
- Issue #28368: Refuse monitoring processes if the child watcher has
no loop attached.
no loop attached.
Patch by Vincent Michel.
Patch by Vincent Michel.
- Issue #28369: Raise RuntimeError when transport'
s
FD
is
used
with
- Issue #28369: Raise RuntimeError when transport'
s
FD
is
used
with
add_reader
,
add_writer
,
etc
.
add_reader
,
add_writer
,
etc
.
-
Issue
#
28370
:
Speedup
asyncio
.
StreamReader
.
readexactly
.
-
Issue
#
28370
:
Speedup
asyncio
.
StreamReader
.
readexactly
.
...
@@ -432,6 +432,8 @@ C API
...
@@ -432,6 +432,8 @@ C API
Tests
Tests
-----
-----
-
Issue
#
28409
:
regrtest
:
fix
the
parser
of
command
line
arguments
.
-
Issue
#
27787
:
Call
gc
.
collect
()
before
checking
each
test
for
"dangling
-
Issue
#
27787
:
Call
gc
.
collect
()
before
checking
each
test
for
"dangling
threads"
,
since
the
dangling
threads
are
weak
references
.
threads"
,
since
the
dangling
threads
are
weak
references
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment