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
Gwenaël Samain
cython
Commits
6b760cb3
Commit
6b760cb3
authored
Aug 11, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py2.6/3.0 import fixes
parent
39389bdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+4
-1
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+5
-2
No files found.
Cython/Compiler/Code.py
View file @
6b760cb3
...
...
@@ -10,7 +10,10 @@ from PyrexTypes import py_object_type, typecast
from
TypeSlots
import
method_coexist
from
Scanning
import
SourceDescriptor
from
Cython.StringIOTree
import
StringIOTree
from
sets
import
Set
as
set
try
:
set
except
NameError
:
from
sets
import
Set
as
set
class
FunctionContext
(
object
):
# Not used for now, perhaps later
...
...
Cython/Compiler/Scanning.py
View file @
6b760cb3
...
...
@@ -38,7 +38,10 @@ def hash_source_file(path):
# Try to calculate a hash code for the given source file.
# Returns an empty string if the file cannot be accessed.
#print "Hashing", path ###
import
md5
try
:
from
hashlib
import
md5
as
new_md5
except
ImportError
:
from
md5
import
new
as
new_md5
try
:
try
:
f
=
open
(
path
,
"rU"
)
...
...
@@ -54,7 +57,7 @@ def hash_source_file(path):
# tabs by a single space.
import
re
text
=
re
.
sub
(
"[
\
t
]+"
,
" "
,
text
)
hash
=
md5
.
new
(
text
).
hexdigest
()
hash
=
new_md5
(
text
).
hexdigest
()
return
hash
def
open_pickled_lexicon
(
expected_hash
):
...
...
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