Coverage for odsclient/utils.py: 50%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

10 statements  

1# Authors: Sylvain MARIE <sylvain.marie@se.com> 

2# + All contributors to <https://github.com/smarie/python-odsclient> 

3# 

4# License: 3-clause BSD, <https://github.com/smarie/python-odsclient/blob/master/LICENSE> 

5import sys 

6 

7from io import BytesIO # to handle byte strings 

8from io import StringIO # to handle unicode strings 

9 

10if sys.version_info >= (3, 0): 10 ↛ 14line 10 didn't jump to line 14, because the condition on line 10 was never false

11 def create_reading_buffer(value, is_literal): 

12 return StringIO(value) 

13else: 

14 def create_reading_buffer(value, is_literal): 

15 if is_literal: 

16 return BytesIO(value) 

17 else: 

18 return StringIO(value)