diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils/general_utils.py')
-rwxr-xr-x | scripts/automation/trex_control_plane/client_utils/general_utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/general_utils.py b/scripts/automation/trex_control_plane/client_utils/general_utils.py index 3d55bc3e..9a510ec5 100755 --- a/scripts/automation/trex_control_plane/client_utils/general_utils.py +++ b/scripts/automation/trex_control_plane/client_utils/general_utils.py @@ -90,9 +90,11 @@ def id_count_gen(): yield return_id return_id += 1 -# try to get integer from input, return None in case of fail -def get_integer(input): +# try to get number from input, return None in case of fail +def get_number(input): try: + if type(input) in (int, long): + return input return int(input) except: return None |