[GRASS-dev] [GRASS-SVN] r74358 - grass/trunk/lib/python/temporal

Stefan Blumentrath Stefan.Blumentrath at nina.no
Wed Apr 10 00:56:04 PDT 2019


Hi Anna and others,

Sorry for the mistake and thanks for the heads up! Good to see that experienced devs are on the watch!
Fixed in r74361

For the record, there is still:
lib/python/imaging/images2swf.py:87:PY3 = sys.version_info[0] == 3
which I did not touch.

Cheers
Stefan

From: grass-dev <grass-dev-bounces at lists.osgeo.org> On Behalf Of Anna Petrášová
Sent: onsdag 10. april 2019 04:37
To: GRASS-dev <grass-dev at lists.osgeo.org>
Cc: grass-commit at lists.osgeo.org
Subject: Re: [GRASS-dev] [GRASS-SVN] r74358 - grass/trunk/lib/python/temporal

Documented here:
https://trac.osgeo.org/grass/wiki/Python3Support#HowtowritePython3compatiblecode

On Tue, Apr 9, 2019 at 10:34 PM Anna Petrášová <kratochanna at gmail.com<mailto:kratochanna at gmail.com>> wrote:
Hi,

it should really be >= 3 to avoid failing for future Python versions:

http://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/

On Tue, Apr 9, 2019 at 5:07 AM <svn_grass at osgeo.org<mailto:svn_grass at osgeo.org>> wrote:
Author: sbl
Date: 2019-04-09 02:07:30 -0700 (Tue, 09 Apr 2019)
New Revision: 74358

Modified:
   grass/trunk/lib/python/temporal/datetime_math.py
   grass/trunk/lib/python/temporal/temporal_algebra.py
Log:
fix python version check

Modified: grass/trunk/lib/python/temporal/datetime_math.py
===================================================================
--- grass/trunk/lib/python/temporal/datetime_math.py    2019-04-08 19:50:21 UTC (rev 74357)
+++ grass/trunk/lib/python/temporal/datetime_math.py    2019-04-09 09:07:30 UTC (rev 74358)
@@ -19,7 +19,7 @@
 except:
     has_dateutil = False

-if sys.version_info[0]:
+if sys.version_info[0] == 3:
     unicode = str

 DAY_IN_SECONDS = 86400

Modified: grass/trunk/lib/python/temporal/temporal_algebra.py
===================================================================
--- grass/trunk/lib/python/temporal/temporal_algebra.py 2019-04-08 19:50:21 UTC (rev 74357)
+++ grass/trunk/lib/python/temporal/temporal_algebra.py 2019-04-09 09:07:30 UTC (rev 74358)
@@ -470,7 +470,7 @@
 from .datetime_math import create_time_suffix
 from .datetime_math import create_numeric_suffix

-if sys.version_info[0]:
+if sys.version_info[0] == 3:
     unicode = str

 ##############################################################################

_______________________________________________
grass-commit mailing list
grass-commit at lists.osgeo.org<mailto:grass-commit at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-commit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190410/c9e12058/attachment-0001.html>


More information about the grass-dev mailing list