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
0f5d7221
Commit
0f5d7221
authored
Nov 12, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timely close Cython source file when generating C source comments
parent
d2fe7355
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+11
-5
No files found.
Cython/Compiler/Code.py
View file @
0f5d7221
...
@@ -759,16 +759,22 @@ class GlobalState(object):
...
@@ -759,16 +759,22 @@ class GlobalState(object):
try:
try:
return self.input_file_contents[source_desc]
return self.input_file_contents[source_desc]
except KeyError:
except KeyError:
pass
source_file = source_desc.get_lines(encoding='ASCII',
error_handling='ignore')
try:
F = [u' * ' + line.rstrip().replace(
F = [u' * ' + line.rstrip().replace(
u'*/', u'*[inserted by cython to avoid comment closer]/'
u'*/', u'*[inserted by cython to avoid comment closer]/'
).replace(
).replace(
u'/*', u'/[inserted by cython to avoid comment start]*'
u'/*', u'/[inserted by cython to avoid comment start]*'
)
)
for line in source_desc.get_lines(encoding='ASCII',
for line in source_file]
error_handling='ignore')]
finally:
if len(F) == 0: F.append(u'')
if hasattr(source_file, 'close'):
self.input_file_contents[source_desc] = F
source_file.close()
return F
if not F: F.append(u'')
self.input_file_contents[source_desc] = F
return F
#
#
# Utility code state
# Utility code state
...
...
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