Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/aniso8601/compat.py: 83%
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
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
1# -*- coding: utf-8 -*-
3# Copyright (c) 2026, Brandon Nielsen
4# SPDX-License-Identifier: BSD-3-Clause
6import sys
8PY2 = sys.version_info[0] == 2
10if PY2: # pragma: no cover
11 range = xrange # pylint: disable=undefined-variable
12else:
13 range = range
16def is_string(tocheck):
17 # pylint: disable=undefined-variable
18 if PY2: # pragma: no cover
19 return isinstance(tocheck, str) or isinstance(tocheck, unicode)
21 return isinstance(tocheck, str)