From a9e59e5696403384c36bc550bf1951957faa7959 Mon Sep 17 00:00:00 2001 From: Auke Klazema <klazema@astron.nl> Date: Wed, 24 Apr 2019 14:39:14 +0000 Subject: [PATCH] SW-658: Fix integer division in ppstune (merged from trunk) --- LCU/PPSTune/ppstune/ppstune.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LCU/PPSTune/ppstune/ppstune.py b/LCU/PPSTune/ppstune/ppstune.py index 80b78d193da..367ae4abd93 100755 --- a/LCU/PPSTune/ppstune/ppstune.py +++ b/LCU/PPSTune/ppstune/ppstune.py @@ -1222,7 +1222,7 @@ def log_cabinet_climate(station): # # #################################### -def station_name(hostname = check_output(['hostname', '-s']).decode("UTF-8")): +def station_name(hostname = check_output(['hostname', '-s'])): r''' Determine station_name by calling the external ``hostname`` utility, and stripping the last character. @@ -1788,7 +1788,7 @@ def find_optimal_delays(diff_error_counts): logging.info('Raw optimum: [%s]', ' '.join([('%3d' % step) for step in optimal_steps])) sorted_filtered_optimal_steps = sorted([step for step in optimal_steps if step >= 0]) - median_optimal_step = sorted_filtered_optimal_steps[len(sorted_filtered_optimal_steps) / 2] + median_optimal_step = sorted_filtered_optimal_steps[len(sorted_filtered_optimal_steps) // 2] median_optimal_step = median_optimal_step % 66 if median_optimal_step > 65: median_optimal_step = 0 -- GitLab