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
Boxiang Sun
cython
Commits
7a17001d
Commit
7a17001d
authored
Dec 16, 2010
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ResourceWarning about unclosed files in Py 3.2
parent
b1f7f744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+5
-1
Cython/Build/Inline.py
Cython/Build/Inline.py
+5
-1
No files found.
Cython/Build/Dependencies.py
View file @
7a17001d
...
...
@@ -220,7 +220,11 @@ def parse_dependencies(source_filename):
# Actual parsing is way to slow, so we use regular expressions.
# The only catch is that we must strip comments and string
# literals ahead of time.
source
=
Utils
.
open_source_file
(
source_filename
,
"rU"
).
read
()
fh
=
Utils
.
open_source_file
(
source_filename
,
"rU"
)
try
:
source
=
fh
.
read
()
finally
:
fh
.
close
()
distutils_info
=
DistutilsInfo
(
source
)
source
,
literals
=
strip_string_literals
(
source
)
source
=
source
.
replace
(
'
\
\
\
n
'
,
' '
)
...
...
Cython/Build/Inline.py
View file @
7a17001d
...
...
@@ -163,7 +163,11 @@ def __invoke(%(params)s):
for key, value in literals.items():
module_code = module_code.replace(key, value)
pyx_file = os.path.join(lib_dir, module_name + '
.
pyx
')
open(pyx_file, '
w
').write(module_code)
fh = open(pyx_file, '
w
')
try:
fh.write(module_code)
finally:
fh.close()
extension = Extension(
name = module_name,
sources = [pyx_file],
...
...
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