ros-infrastructure / rosdoc_lite

A light-weight version of rosdoc that does not rely on ROS infrastructure for crawling packages.
10 stars 31 forks source link

Unable to import module in Python3 #83

Closed pauldinh closed 4 years ago

pauldinh commented 5 years ago

There are a few instances in the package that use the < Python 2.6 syntax for exception handling. This can cause failures when trying to import the module in Python 3 which no longer supports that syntax. Example:

user@host:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
user@host:~ $ dpkg -l | rg rosdoc
ii  ros-kinetic-rosdoc-lite                                     0.2.7-0xenial-20180824-081737-0800                    amd64        This ROS package wraps documentation tools like doxygen, sphinx, and epydoc, making it convenient to generate ROS package documentation.
user@host:~ $ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rosdoc_lite
>>> quit()
user@host:~ $ python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rosdoc_lite
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosdoc_lite/__init__.py", line 188
    except Exception, e:
                    ^
SyntaxError: invalid syntax
sloretz commented 4 years ago

It looks like this was fixed by #83. I don't see any syntax errors using python3 -m flake8 --select E999