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
Kirill Smelkov
cython
Commits
aff88c52
Commit
aff88c52
authored
Feb 11, 2018
by
scoder
Committed by
GitHub
Feb 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2095 from jdemeyer/atexit_close
Use NamedTemporaryFile instead of mkstemp
parents
223ab47f
bb4f0a9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Cython/Debugger/libpython.py
Cython/Debugger/libpython.py
+4
-6
No files found.
Cython/Debugger/libpython.py
View file @
aff88c52
...
...
@@ -1941,7 +1941,6 @@ PyLocals()
##################################################################
import re
import atexit
import warnings
import tempfile
import textwrap
...
...
@@ -2023,14 +2022,13 @@ class _LoggingState(object):
"""
def __init__(self):
self.fd, self.filename = tempfile.mkstemp()
self.file = os.fdopen(self.fd, 'r+')
f = tempfile.NamedTemporaryFile('r+')
self.file = f
self.filename = f.name
self.fd = f.fileno()
_execute("
set
logging
file
%
s
" % self.filename)
self.file_position_stack = []
atexit.register(os.close, self.fd)
atexit.register(os.remove, self.filename)
def __enter__(self):
if not self.file_position_stack:
_execute("
set
logging
redirect
on
")
...
...
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