[GRASS-dev] [GRASS GIS] #3493: Compilation error with python 2.6

#3493: Compilation error with python 2.6
-----------------------+-------------------------
Reporter: vesnikos | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Compiling | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Linux |
-----------------------+-------------------------
Tried to compile the latest grass from source, I got this error:

Traceback (most recent call last):
   File "/home/nv1g17/grass/dist.x86_64-pc-linux-gnu/tools/mkhtml.py", line
38, in <module>
     if sys.version_info.major == 2:
AttributeError: 'tuple' object has no attribute 'major'
make[4]: *** [/home/xxxxx/grass/dist.x86_64-pc-linux-
gnu/docs/html/pngdriver.html] Error 1

my python:

Python 2.6.6 (r266:84292, May 1 2012, 13:52:17)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3493&gt;
GRASS GIS <https://grass.osgeo.org>

#3493: Compilation error with python 2.6
--------------------------+-------------------------
  Reporter: vesnikos | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Compiling | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------
Changes (by mmetz):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"72236" 72236]:
{{{
#!CommitTicketReference repository="" revision="72236"
restore compatibility with python2.6- (fixes #3493)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3493#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3493: Compilation error with python 2.6
--------------------------+-------------------------
  Reporter: vesnikos | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: normal | Milestone: 7.4.1
Component: Compiling | Version: svn-trunk
Resolution: | Keywords: python
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------
Changes (by neteler):

* status: closed => reopened
* keywords: => python
* resolution: fixed =>
* milestone: => 7.4.1

Comment:

Re-opened for backport

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3493#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3493: Compilation error with python 2.6
--------------------------+-------------------------
  Reporter: vesnikos | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.1
Component: Compiling | Version: svn-trunk
Resolution: fixed | Keywords: python
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------
Changes (by mmetz):

* status: reopened => closed
* resolution: => fixed

Comment:

Replying to [comment:2 neteler]:
> Re-opened for backport

New in trunk, does not apply to 7.4-, thus fixed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3493#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3493: Compilation error with python 2.6
--------------------------+-------------------------
  Reporter: vesnikos | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.4.1
Component: Compiling | Version: svn-trunk
Resolution: fixed | Keywords: python
       CPU: Unspecified | Platform: Linux
--------------------------+-------------------------

Comment (by wenzeslaus):

Note that `sys.version_info.major` is at more places.
`sys.version_info[0]` works all right in 3, but in general I'm not sure if
we can maintain 2.6 compatibility while using 3
(https://docs.python.org/3/howto/pyporting.html#drop-support-for-
python-2-6-and-older).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3493#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>