Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
f03092b1
Commit
f03092b1
authored
Feb 12, 2017
by
scoder
Committed by
GitHub
Feb 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1576 from jelmer/reproducible
Encode relative path to working tree in code paths when possible.
parents
ef6d1961
372f1be5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
f03092b1
...
...
@@ -9047,7 +9047,15 @@ class CodeObjectNode(ExprNode):
func_name
=
code
.
get_py_string_const
(
func
.
name
,
identifier
=
True
,
is_str
=
False
,
unicode_value
=
func
.
name
)
# FIXME: better way to get the module file path at module init time? Encoding to use?
file_path
=
StringEncoding
.
bytes_literal
(
func
.
pos
[
0
].
get_filenametable_entry
().
encode
(
'utf8'
),
'utf8'
)
file_abspath
=
func
.
pos
[
0
].
get_filenametable_entry
()
# Prefer relative paths to current directory (which is most likely the project root)
# over absolute paths.
workdir
=
os
.
getcwd
()
+
os
.
sep
if
file_abspath
.
startswith
(
workdir
):
file_path
=
file_abspath
[
len
(
workdir
):]
else
:
file_path
=
file_abspath
file_path
=
StringEncoding
.
bytes_literal
(
file_path
.
encode
(
'utf8'
),
'utf8'
)
file_path_const
=
code
.
get_py_string_const
(
file_path
,
identifier
=
False
,
is_str
=
True
)
flags
=
[]
...
...
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