Mercurial > kallithea
comparison rhodecode/lib/subprocessio.py @ 2565:79db9abad657 beta
I failed at import :]
- use bytes() instead of b''
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 06 Jul 2012 19:30:16 +0200 |
parents | 9a99b574bb48 |
children | 71fc1c98e02a |
comparison
equal
deleted
inserted
replaced
2564:9a99b574bb48 | 2565:79db9abad657 |
---|---|
20 | 20 |
21 You should have received a copy of the GNU Lesser General Public License | 21 You should have received a copy of the GNU Lesser General Public License |
22 along with git_http_backend.py Project. | 22 along with git_http_backend.py Project. |
23 If not, see <http://www.gnu.org/licenses/>. | 23 If not, see <http://www.gnu.org/licenses/>. |
24 ''' | 24 ''' |
25 from __future__ import unicode_literals | |
26 import os | 25 import os |
27 import subprocess | 26 import subprocess |
28 import threading | 27 import threading |
29 from collections import deque | 28 from collections import deque |
30 | 29 |
38 """ | 37 """ |
39 def __init__(self, source): | 38 def __init__(self, source): |
40 super(StreamFeeder, self).__init__() | 39 super(StreamFeeder, self).__init__() |
41 self.daemon = True | 40 self.daemon = True |
42 filelike = False | 41 filelike = False |
43 self.bytes = b'' | 42 self.bytes = bytes() |
44 if type(source) in (type(''), bytes, bytearray): # string-like | 43 if type(source) in (type(''), bytes, bytearray): # string-like |
45 self.bytes = bytes(source) | 44 self.bytes = bytes(source) |
46 else: # can be either file pointer or file-like | 45 else: # can be either file pointer or file-like |
47 if type(source) in (int, long): # file pointer it is | 46 if type(source) in (int, long): # file pointer it is |
48 ## converting file descriptor (int) stdin into file-like | 47 ## converting file descriptor (int) stdin into file-like |