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
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
Show 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):
...
@@ -220,7 +220,11 @@ def parse_dependencies(source_filename):
# Actual parsing is way to slow, so we use regular expressions.
# Actual parsing is way to slow, so we use regular expressions.
# The only catch is that we must strip comments and string
# The only catch is that we must strip comments and string
# literals ahead of time.
# 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
)
distutils_info
=
DistutilsInfo
(
source
)
source
,
literals
=
strip_string_literals
(
source
)
source
,
literals
=
strip_string_literals
(
source
)
source
=
source
.
replace
(
'
\
\
\
n
'
,
' '
)
source
=
source
.
replace
(
'
\
\
\
n
'
,
' '
)
...
...
Cython/Build/Inline.py
View file @
7a17001d
...
@@ -163,7 +163,11 @@ def __invoke(%(params)s):
...
@@ -163,7 +163,11 @@ def __invoke(%(params)s):
for key, value in literals.items():
for key, value in literals.items():
module_code = module_code.replace(key, value)
module_code = module_code.replace(key, value)
pyx_file = os.path.join(lib_dir, module_name + '
.
pyx
')
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(
extension = Extension(
name = module_name,
name = module_name,
sources = [pyx_file],
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