Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pyasn1/compat/string.py: 27%

11 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-26 06:25 +0000

1# 

2# This file is part of pyasn1 software. 

3# 

4# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> 

5# License: http://snmplabs.com/pyasn1/license.html 

6# 

7from sys import version_info 

8 

9if version_info[:2] <= (2, 5): 

10 

11 def partition(string, sep): 

12 try: 

13 a, c = string.split(sep, 1) 

14 

15 except ValueError: 

16 a, b, c = string, '', '' 

17 

18 else: 

19 b = sep 

20 

21 return a, b, c 

22 

23else: 

24 

25 def partition(string, sep): 

26 return string.partition(sep)