Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/aniso8601/compat.py: 67%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

6 statements  

1# -*- coding: utf-8 -*- 

2 

3# Copyright (c) 2025, Brandon Nielsen 

4# All rights reserved. 

5# 

6# This software may be modified and distributed under the terms 

7# of the BSD license. See the LICENSE file for details. 

8 

9import sys 

10 

11PY2 = sys.version_info[0] == 2 

12 

13if PY2: # pragma: no cover 

14 range = xrange # pylint: disable=undefined-variable 

15else: 

16 range = range 

17 

18 

19def is_string(tocheck): 

20 # pylint: disable=undefined-variable 

21 if PY2: # pragma: no cover 

22 return isinstance(tocheck, str) or isinstance(tocheck, unicode) 

23 

24 return isinstance(tocheck, str)