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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
e1939379
Commit
e1939379
authored
Jul 05, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 fixes
parent
e76ea8ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/Scanning.py
Cython/Compiler/Scanning.py
+1
-1
Cython/Compiler/TreeFragment.py
Cython/Compiler/TreeFragment.py
+5
-2
Cython/Plex/Transitions.py
Cython/Plex/Transitions.py
+1
-1
No files found.
Cython/Compiler/Scanning.py
View file @
e1939379
...
...
@@ -65,7 +65,7 @@ def hash_source_file(path):
# tabs by a single space.
import
re
text
=
re
.
sub
(
"[
\
t
]+"
,
" "
,
text
)
hash
=
new_md5
(
text
).
hexdigest
()
hash
=
new_md5
(
text
.
encode
(
"ASCII"
)
).
hexdigest
()
return
hash
def
open_pickled_lexicon
(
expected_hash
):
...
...
Cython/Compiler/TreeFragment.py
View file @
e1939379
...
...
@@ -3,7 +3,10 @@
#
import
re
from
cStringIO
import
StringIO
try
:
from
cStringIO
import
BytesIO
# Py3 mangled by 2to3 ...
except
ImportError
:
from
cStringIO
import
StringIO
as
BytesIO
# Py3 mangled by 2to3 ...
from
Scanning
import
PyrexScanner
,
StringSourceDescriptor
from
Symtab
import
BuiltinScope
,
ModuleScope
import
Symtab
...
...
@@ -54,7 +57,7 @@ def parse_from_strings(name, code, pxds={}, level=None, initial_pos=None):
context
=
StringParseContext
([],
name
)
scope
=
context
.
find_module
(
module_name
,
pos
=
initial_pos
,
need_pxd
=
0
)
buf
=
String
IO
(
code
.
encode
(
encoding
))
buf
=
Bytes
IO
(
code
.
encode
(
encoding
))
scanner
=
PyrexScanner
(
buf
,
code_source
,
source_encoding
=
encoding
,
scope
=
scope
,
context
=
context
,
initial_pos
=
initial_pos
)
...
...
Cython/Plex/Transitions.py
View file @
e1939379
...
...
@@ -131,7 +131,7 @@ class TransitionMap(object):
# loop invariant: map[lo] <= code < map[hi] and hi - lo >= 2
while
hi
-
lo
>=
4
:
# Find midpoint truncated to even index
mid
=
((
lo
+
hi
)
/
2
)
&
~
1
mid
=
((
lo
+
hi
)
/
/
2
)
&
~
1
if
code
<
map
[
mid
]:
hi
=
mid
else
:
...
...
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