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
90fe3168
Commit
90fe3168
authored
Jul 05, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix TreeFragment: parsing works on Unicode streams
parent
75289aca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
Cython/Compiler/TreeFragment.py
Cython/Compiler/TreeFragment.py
+2
-5
No files found.
Cython/Compiler/TreeFragment.py
View file @
90fe3168
...
@@ -3,10 +3,7 @@
...
@@ -3,10 +3,7 @@
#
#
import
re
import
re
try
:
from
StringIO
import
StringIO
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
Scanning
import
PyrexScanner
,
StringSourceDescriptor
from
Symtab
import
BuiltinScope
,
ModuleScope
from
Symtab
import
BuiltinScope
,
ModuleScope
import
Symtab
import
Symtab
...
@@ -57,7 +54,7 @@ def parse_from_strings(name, code, pxds={}, level=None, initial_pos=None):
...
@@ -57,7 +54,7 @@ def parse_from_strings(name, code, pxds={}, level=None, initial_pos=None):
context
=
StringParseContext
([],
name
)
context
=
StringParseContext
([],
name
)
scope
=
context
.
find_module
(
module_name
,
pos
=
initial_pos
,
need_pxd
=
0
)
scope
=
context
.
find_module
(
module_name
,
pos
=
initial_pos
,
need_pxd
=
0
)
buf
=
BytesIO
(
code
.
encode
(
encoding
)
)
buf
=
StringIO
(
code
)
scanner
=
PyrexScanner
(
buf
,
code_source
,
source_encoding
=
encoding
,
scanner
=
PyrexScanner
(
buf
,
code_source
,
source_encoding
=
encoding
,
scope
=
scope
,
context
=
context
,
initial_pos
=
initial_pos
)
scope
=
scope
,
context
=
context
,
initial_pos
=
initial_pos
)
...
...
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