summaryrefslogtreecommitdiff
path: root/leapsecond.py
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-04-09 19:57:16 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-04-10 04:59:07 -0400
commit4ce87b1b589e6241553d20c72716954cdb415210 (patch)
treeb006eae040b42bb9c8dd228668ac322ee984aa25 /leapsecond.py
parentf089f6d2dda9fa95bdf9b0e1e8ede9fa61ce087c (diff)
downloadgpsd-4ce87b1b589e6241553d20c72716954cdb415210.tar.gz
Makes "future imports" and Python version comments consistent.
This makes the "future import" statements consistently specify absolute_import, print_function, and division, for maximum consistency between Python 2 and Python 3. Although absolute_import is probably a don't care for top-level programs, if unit tests were ever implemented for the programs they would be imported as modules, making the module import behavior relevant. Note that previous Python 3 fixes are a prerequisite for this change. Also makes the "polyglot comment" consistent across sources. TESTED: Using a version of SConstruct patched to use the target Python for build helpers, ran "scons build-all check valgrind-audit www/hardware.html" with all six supported Python versions. Also ran gegps, gpscat, gpsprof, xgps, and xgpsspeed with both Python 2 and Python 3.
Diffstat (limited to 'leapsecond.py')
-rwxr-xr-xleapsecond.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/leapsecond.py b/leapsecond.py
index e43f353d..2f0ce8fb 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -43,8 +43,9 @@ This file is Copyright (c) 2013 by the GPSD project
BSD terms apply: see the file COPYING in the distribution root for details.
"""
-# This code runs under both Python 2 and Python 3. Preserve this property!
-from __future__ import print_function, division
+# This code runs compatibly under Python 2 and 3.x for x >= 2.
+# Preserve this property!
+from __future__ import absolute_import, print_function, division
import os, re, random, time, calendar, math, sys, signal