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
« 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
9if version_info[:2] <= (2, 5):
11 def partition(string, sep):
12 try:
13 a, c = string.split(sep, 1)
15 except ValueError:
16 a, b, c = string, '', ''
18 else:
19 b = sep
21 return a, b, c
23else:
25 def partition(string, sep):
26 return string.partition(sep)