Commit 83726b6d authored by Jason Madden's avatar Jason Madden

And again for sys.stderr.

parent e5907043
...@@ -301,7 +301,8 @@ class FileObjectThread(FileObjectBase): ...@@ -301,7 +301,8 @@ class FileObjectThread(FileObjectBase):
self.lock = DummySemaphore() self.lock = DummySemaphore()
if not hasattr(self.lock, '__enter__'): if not hasattr(self.lock, '__enter__'):
raise TypeError('Expected a Semaphore or boolean, got %r' % type(self.lock)) raise TypeError('Expected a Semaphore or boolean, got %r' % type(self.lock))
universal_newline = 'U' in mode or newline is None using_fileio = self._use_FileIO(mode.replace('U', ''), encoding, errors)
universal_newline = 'U' in mode or (not using_fileio and newline is None)
mode = mode.replace('U', '') mode = mode.replace('U', '')
fobj = self._open_raw(fobj, mode, bufsize, fobj = self._open_raw(fobj, mode, bufsize,
encoding=encoding, errors=errors, newline=newline, encoding=encoding, errors=errors, newline=newline,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment