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
9e708961
Commit
9e708961
authored
Aug 28, 2017
by
Jason R. Coombs
Committed by
GitHub
Aug 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Need to perform the local assertion before checking for existence.
parent
3c25384f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
setuptools/config.py
setuptools/config.py
+6
-7
No files found.
setuptools/config.py
View file @
9e708961
...
...
@@ -262,21 +262,20 @@ class ConfigHandler(object):
spec
=
value
[
len
(
include_directive
):]
filepaths
=
(
os
.
path
.
abspath
(
path
.
strip
())
for
path
in
spec
.
split
(
','
))
return
'
\
n
'
.
join
(
cls
.
_read_
local_
file
(
path
)
cls
.
_read_file
(
path
)
for
path
in
filepaths
if
os
.
path
.
isfile
(
path
)
if
(
cls
.
_assert_local
(
path
)
or
True
)
and
os
.
path
.
isfile
(
path
)
)
@
staticmethod
def
_read_local_file
(
filepath
):
"""
Read contents of filepath. Raise error if the file
isn't in the current directory.
"""
def
_assert_local
(
filepath
):
if
not
filepath
.
startswith
(
os
.
getcwd
()):
raise
DistutilsOptionError
(
'`file:` directive can not access %s'
%
filepath
)
@
staticmethod
def
_read_file
(
filepath
):
with
io
.
open
(
filepath
,
encoding
=
'utf-8'
)
as
f
:
return
f
.
read
()
...
...
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