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
2ca61ff0
Commit
2ca61ff0
authored
Sep 16, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify file hashing code in cythonize() dependency tracking.
parent
b306bc04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+3
-7
No files found.
Cython/Build/Dependencies.py
View file @
2ca61ff0
...
...
@@ -113,18 +113,14 @@ def nonempty(it, error_msg="expected non-empty iterator"):
@
cached_function
def
file_hash
(
filename
):
path
=
os
.
path
.
normpath
(
filename
.
encode
(
"UTF-8"
)
)
prefix
=
(
str
(
len
(
path
))
+
":"
).
encode
(
"UTF-8"
)
path
=
os
.
path
.
normpath
(
filename
)
prefix
=
(
'%d:%s'
%
(
len
(
path
),
path
)
).
encode
(
"UTF-8"
)
m
=
hashlib
.
md5
(
prefix
)
m
.
update
(
path
)
f
=
open
(
filename
,
'rb'
)
try
:
with
open
(
path
,
'rb'
)
as
f
:
data
=
f
.
read
(
65000
)
while
data
:
m
.
update
(
data
)
data
=
f
.
read
(
65000
)
finally
:
f
.
close
()
return
m
.
hexdigest
()
...
...
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