Run pylog tests using Python 3.8
[logging-analytics.git] / pylog / onaplogging / utils / system.py
1 # Copyright (c) 2020 Deutsche Telekom.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #       http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
11 import sys
12
13
14 def is_above_python_3_2():
15     # type: () -> bool
16     """Check if code is running at least on Python 3.2 version.
17
18     Returns:
19         bool: True if it's at least 3.2 version, False otherwise
20     """
21     return sys.version_info >= (3, 2, 0, "final", 0)
22
23
24 def is_above_python_2_7():
25     # type: () -> bool
26     """Check if code is running at least on Python 2.7 version.
27
28     Returns:
29         bool: True if it's at least 2.7 version, False otherwise
30     """
31     return sys.version_info >= (2, 7, 0, "final", 0)