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

Anna Petrášová kratochanna at gmail.com
Tue Apr 9 19:37:24 PDT 2019


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>
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> 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
>> https://lists.osgeo.org/mailman/listinfo/grass-commit
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190409/7a50ef79/attachment.html>


More information about the grass-dev mailing list