Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
5ff2e55d
Commit
5ff2e55d
authored
Nov 01, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reapplied r74493 (after #6665 fix has been backported)
parent
4d70c7aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
filelist.py
filelist.py
+3
-1
tests/test_build_py.py
tests/test_build_py.py
+2
-1
tests/test_filelist.py
tests/test_filelist.py
+7
-7
No files found.
filelist.py
View file @
5ff2e55d
...
...
@@ -312,7 +312,9 @@ def translate_pattern(pattern, anchor=1, prefix=None, is_regex=0):
pattern_re = ''
if prefix is not None:
prefix_re = (glob_to_re(prefix))[0:-1] # ditch trailing $
# ditch end of pattern character
empty_pattern = glob_to_re('')
prefix_re = (glob_to_re(prefix))[:-len(empty_pattern)]
pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re)
else: # no prefix -- respect anchor flag
if anchor:
...
...
tests/test_build_py.py
View file @
5ff2e55d
...
...
@@ -69,6 +69,7 @@ class BuildPyTestCase(support.TempdirManager,
open
(
os
.
path
.
join
(
testdir
,
"testfile"
),
"w"
).
close
()
os
.
chdir
(
sources
)
old_stdout
=
sys
.
stdout
sys
.
stdout
=
io
.
StringIO
()
try
:
...
...
@@ -87,7 +88,7 @@ class BuildPyTestCase(support.TempdirManager,
finally
:
# Restore state.
os
.
chdir
(
cwd
)
sys
.
stdout
=
sys
.
__stdout__
sys
.
stdout
=
old_stdout
def
test_dont_write_bytecode
(
self
):
# makes sure byte_compile is not used
...
...
tests/test_filelist.py
View file @
5ff2e55d
...
...
@@ -9,15 +9,15 @@ class FileListTestCase(unittest.TestCase):
def
test_glob_to_re
(
self
):
# simple cases
self
.
assertEquals
(
glob_to_re
(
'foo*'
),
'foo[^/]*
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo?'
),
'foo[^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo??'
),
'foo[^/][^/]
$
'
)
self
.
assertEquals
(
glob_to_re
(
'foo*'
),
'foo[^/]*
\
\
Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
'foo?'
),
'foo[^/]
\
\
Z(?ms)
'
)
self
.
assertEquals
(
glob_to_re
(
'foo??'
),
'foo[^/][^/]
\
\
Z(?ms)
'
)
# special cases
self
.
assertEquals
(
glob_to_re
(
r'foo\\*'
),
r'foo\\\\[^/]*
$
'
)
self
.
assertEquals
(
glob_to_re
(
r'foo\\\
*
'), r'
foo
\\\\\\
[
^/
]
*
$
')
self.assertEquals(glob_to_re('
foo
????
'), r'
foo
[
^/
][
^/
][
^/
][
^/
]
$
')
self.assertEquals(glob_to_re(r'
foo
\\
??
'), r'
foo
\\\\
[
^/
][
^/
]
$
')
self
.
assertEquals
(
glob_to_re
(
r'foo\\*'
),
r'foo\\\\[^/]*
\
Z(?ms)
')
self.assertEquals(glob_to_re(r'
foo
\\\
*
'), r'
foo
\\\\\\
[
^/
]
*
\
Z
(
?
ms
)
')
self.assertEquals(glob_to_re('
foo
????
'), r'
foo
[
^/
][
^/
][
^/
][
^/
]
\
Z
(
?
ms
)
')
self.assertEquals(glob_to_re(r'
foo
\\
??
'), r'
foo
\\\\
[
^/
][
^/
]
\
Z
(
?
ms
)
')
def test_debug_print(self):
file_list = FileList()
...
...
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