Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c4e78b11
Commit
c4e78b11
authored
May 02, 2019
by
Zackery Spytz
Committed by
Serhiy Storchaka
May 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)
parent
0d5864fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
Lib/test/test_tools/test_lll.py
Lib/test/test_tools/test_lll.py
+38
-0
Misc/NEWS.d/next/Tools-Demos/2019-04-30-14-30-29.bpo-14546.r38Y-6.rst
...next/Tools-Demos/2019-04-30-14-30-29.bpo-14546.r38Y-6.rst
+1
-0
Tools/scripts/lll.py
Tools/scripts/lll.py
+3
-4
No files found.
Lib/test/test_tools/test_lll.py
0 → 100644
View file @
c4e78b11
"""Tests for the lll script in the Tools/script directory."""
import
os
import
tempfile
from
test
import
support
from
test.test_tools
import
skip_if_missing
,
import_tool
import
unittest
skip_if_missing
()
class
lllTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
lll
=
import_tool
(
'lll'
)
def
test_lll_multiple_dirs
(
self
):
with
tempfile
.
TemporaryDirectory
()
as
dir1
,
\
tempfile
.
TemporaryDirectory
()
as
dir2
:
fn1
=
os
.
path
.
join
(
dir1
,
'foo1'
)
fn2
=
os
.
path
.
join
(
dir2
,
'foo2'
)
for
fn
,
dir
in
(
fn1
,
dir1
),
(
fn2
,
dir2
):
open
(
fn
,
'w'
).
close
()
os
.
symlink
(
fn
,
os
.
path
.
join
(
dir
,
'symlink'
))
with
support
.
captured_stdout
()
as
output
:
self
.
lll
.
main
([
dir1
,
dir2
])
self
.
assertEqual
(
output
.
getvalue
(),
f'
{
dir1
}
:
\
n
'
f'symlink ->
{
fn1
}\
n
'
f'
\
n
'
f'
{
dir2
}
:
\
n
'
f'symlink ->
{
fn2
}\
n
'
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Misc/NEWS.d/next/Tools-Demos/2019-04-30-14-30-29.bpo-14546.r38Y-6.rst
0 → 100644
View file @
c4e78b11
Fix the argument handling in Tools/scripts/lll.py.
Tools/scripts/lll.py
View file @
c4e78b11
...
...
@@ -13,8 +13,7 @@ def lll(dirname):
full
=
os
.
path
.
join
(
dirname
,
name
)
if
os
.
path
.
islink
(
full
):
print
(
name
,
'->'
,
os
.
readlink
(
full
))
def
main
():
args
=
sys
.
argv
[
1
:]
def
main
(
args
):
if
not
args
:
args
=
[
os
.
curdir
]
first
=
1
for
arg
in
args
:
...
...
@@ -22,7 +21,7 @@ def main():
if
not
first
:
print
()
first
=
0
print
(
arg
+
':'
)
lll
(
arg
)
lll
(
arg
)
if
__name__
==
'__main__'
:
main
()
main
(
sys
.
argv
[
1
:]
)
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