open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
72 stars 90 forks source link

fix compiler warning #138

Closed pkalever closed 6 years ago

pkalever commented 6 years ago

build.log:

[...] Error compiling '/builddir/build/BUILDROOT/python-rtslib-2.1.fb68-1.el8.noarch/usr/lib/python3.6/site-packages/rtslib/root.py'... File "/usr/lib/python3.6/root.py", line 191 except IOError, e: ^ SyntaxError: invalid syntax Error compiling '/builddir/build/BUILDROOT/python-rtslib-2.1.fb68-1.el8.noarch/usr/lib/python3.6/site-packages/rtslib_fb/root.py'... File "/usr/lib/python3.6/root.py", line 191 except IOError, e: [...]

Thanks to Maurizio Lombardi mlombard@redhat.com for finding it.

Signed-off-by: Prasanna Kumar Kalever prasanna.kalever@redhat.com

pkalever commented 6 years ago

@maurizio-lombardi please reveiw :-)

Thanks!

maurizio-lombardi commented 6 years ago

In Python 3.x, using "as" is required to assign an exception to a variable. The " , " syntax is compatible only with Python 2.x

Adopting the "as" syntax will fix the problem with Python3.x but won't be compatible with Python <= 2.5