Skip to content

Commit

Permalink
use new exception syntax suported by python-2.6
Browse files Browse the repository at this point in the history
Fixes issue #140
  • Loading branch information
pixelb committed Nov 24, 2017
1 parent 4b931d0 commit 8d88583
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -9,7 +9,7 @@ Standards-Version: 3.8.0

Package: fslint
Architecture: all
Depends: python (>= 2.3), python-gtk2 (>= 2.4), python-glade2, findutils (>=4.1.1)
Depends: python (>= 2.6), python-gtk2 (>= 2.4), python-glade2, findutils (>=4.1.1)
Description: A utility to fix problems with filesystems' data, like duplicate files
FSlint is a toolkit to clean filesystem lint. It includes a GTK+ GUI
as well as a command line interface and can be used to reclaim disk space.
Expand Down
2 changes: 1 addition & 1 deletion doc/README
Expand Up @@ -37,7 +37,7 @@ In addition for the gui versions:

For the 2.40 branch (fedora core 2 or higher)
gtk2 >= 2.4 (ftp://ftp.gtk.org/pub/gtk/)
python >= 2.3 (http://www.python.org/download/)
python >= 2.6 (http://www.python.org/download/)
libglade >= 2.4 (http://ftp.gnome.org/pub/GNOME/sources/libglade/)
pygtk2 >= 2.4 (ftp://ftp.gtk.org/pub/gtk/python/)

Expand Down
4 changes: 2 additions & 2 deletions fslint-gui
Expand Up @@ -187,7 +187,7 @@ try:
if ("--version","") in lOpts:
puts("FSlint 2.47")
sys.exit(None)
except getopt.error, msg:
except getopt.error as msg:
puts(msg)
puts()
Usage()
Expand Down Expand Up @@ -1939,7 +1939,7 @@ on your system at present."))
os.symlink(os.path.realpath(keepfile),tmpfile)
else:
os.link(keepfile,tmpfile)
except OSError, value:
except OSError as value:
if value.errno == errno.EXDEV and not symlink:
os.symlink(os.path.realpath(keepfile),tmpfile)
else:
Expand Down
2 changes: 1 addition & 1 deletion fslint/fstool/dupwaste
Expand Up @@ -67,7 +67,7 @@ try:
# No options get the default bytes.
else:
print "Total wasted space: %d bytes" % sum(sizes())
except getopt.error, msg:
except getopt.error as msg:
print msg
Usage()
sys.exit(1)
4 changes: 2 additions & 2 deletions fslint/supprt/md5sum_approx
Expand Up @@ -53,7 +53,7 @@ def md5sum(filename, CHUNK=CHUNK_SIZE):
del fo

return sum.hexdigest()
except (IOError, OSError), value:
except EnvironmentError as value:
# One gets the following if you do
# fo.seek(-CHUNK, 2) above and file is too small
if value.errno == errno.EINVAL:
Expand All @@ -64,7 +64,7 @@ def md5sum(filename, CHUNK=CHUNK_SIZE):
def printsum(filename):
try:
sys.stdout.write("%s %s\n" % (md5sum(filename),filename))
except (IOError, OSError), value:
except EnvironmentError as value:
sys.stderr.write("md5sum: %s: %s\n" % (filename, value.strerror))

map(printsum, sys.argv[1:])
2 changes: 1 addition & 1 deletion fslint/supprt/rmlint/fixdup
Expand Up @@ -61,7 +61,7 @@ for line in sys.stdin:
os.symlink(os.path.realpath(keepfile),tmpfile)
else:
os.link(keepfile,tmpfile)
except OSError, value:
except EnvironmentError as value:
if value.errno == errno.EXDEV and not symlink:
os.symlink(os.path.realpath(keepfile),tmpfile)
else:
Expand Down

0 comments on commit 8d88583

Please sign in to comment.