<div dir="ltr"><div dir="ltr"><div dir="ltr">Documented here:</div><div dir="ltr"><a href="https://trac.osgeo.org/grass/wiki/Python3Support#HowtowritePython3compatiblecode">https://trac.osgeo.org/grass/wiki/Python3Support#HowtowritePython3compatiblecode</a><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 10:34 PM Anna Petrášová <<a href="mailto:kratochanna@gmail.com">kratochanna@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>it should really be >= 3 to avoid failing for future Python versions:</div><div><br></div><div><a href="http://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/" target="_blank">http://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 5:07 AM <<a href="mailto:svn_grass@osgeo.org" target="_blank">svn_grass@osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: sbl<br>
Date: 2019-04-09 02:07:30 -0700 (Tue, 09 Apr 2019)<br>
New Revision: 74358<br>
<br>
Modified:<br>
grass/trunk/lib/python/temporal/datetime_math.py<br>
grass/trunk/lib/python/temporal/temporal_algebra.py<br>
Log:<br>
fix python version check<br>
<br>
Modified: grass/trunk/lib/python/temporal/datetime_math.py<br>
===================================================================<br>
--- grass/trunk/lib/python/temporal/datetime_math.py 2019-04-08 19:50:21 UTC (rev 74357)<br>
+++ grass/trunk/lib/python/temporal/datetime_math.py 2019-04-09 09:07:30 UTC (rev 74358)<br>
@@ -19,7 +19,7 @@<br>
except:<br>
has_dateutil = False<br>
<br>
-if sys.version_info[0]:<br>
+if sys.version_info[0] == 3:<br>
unicode = str<br>
<br>
DAY_IN_SECONDS = 86400<br>
<br>
Modified: grass/trunk/lib/python/temporal/temporal_algebra.py<br>
===================================================================<br>
--- grass/trunk/lib/python/temporal/temporal_algebra.py 2019-04-08 19:50:21 UTC (rev 74357)<br>
+++ grass/trunk/lib/python/temporal/temporal_algebra.py 2019-04-09 09:07:30 UTC (rev 74358)<br>
@@ -470,7 +470,7 @@<br>
from .datetime_math import create_time_suffix<br>
from .datetime_math import create_numeric_suffix<br>
<br>
-if sys.version_info[0]:<br>
+if sys.version_info[0] == 3:<br>
unicode = str<br>
<br>
##############################################################################<br>
<br>
_______________________________________________<br>
grass-commit mailing list<br>
<a href="mailto:grass-commit@lists.osgeo.org" target="_blank">grass-commit@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-commit" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-commit</a></blockquote></div>
</blockquote></div></div></div>