summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2021-06-04 16:53:52 +0200
committerChristoph Erhardt <kolab@sicherha.de>2022-01-10 20:46:43 +0100
commit991255eaa314b51e2dd586460311d4633a56eb86 (patch)
treee3e711046511d69fabdac2c67e66df4834a1e763 /ext
parentd0579b7e5da331576b80b9d35eb62994075bc939 (diff)
downloadpykolab-991255eaa314b51e2dd586460311d4633a56eb86.tar.gz
[Python 3] Use new exception syntax
Summary: The new syntax was introduced in Python 2.6; the old syntax was deprecated in Python 3.0. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3232
Diffstat (limited to 'ext')
-rw-r--r--ext/python/Tools/freeze/checkextensions_win32.py2
-rwxr-xr-xext/python/Tools/freeze/freeze.py6
-rw-r--r--ext/python/Tools/freeze/winmakemakefile.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/ext/python/Tools/freeze/checkextensions_win32.py b/ext/python/Tools/freeze/checkextensions_win32.py
index a198ecf..ba3853c 100644
--- a/ext/python/Tools/freeze/checkextensions_win32.py
+++ b/ext/python/Tools/freeze/checkextensions_win32.py
@@ -131,7 +131,7 @@ def parse_dsp(dsp):
dsp_path, dsp_name = os.path.split(dsp)
try:
lines = open(dsp, "r").readlines()
- except IOError, msg:
+ except IOError as msg:
sys.stderr.write("%s: %s\n" % (dsp, msg))
return None
for line in lines:
diff --git a/ext/python/Tools/freeze/freeze.py b/ext/python/Tools/freeze/freeze.py
index daa345b..a7906b1 100755
--- a/ext/python/Tools/freeze/freeze.py
+++ b/ext/python/Tools/freeze/freeze.py
@@ -145,7 +145,7 @@ def main():
if sys.argv[pos] == '-i':
try:
options = open(sys.argv[pos+1]).read().split()
- except IOError, why:
+ except IOError as why:
usage("File name '%s' specified with the -i option "
"can not be read - %s" % (sys.argv[pos+1], why) )
# Replace the '-i' and the filename with the read params.
@@ -156,7 +156,7 @@ def main():
# Now parse the command line with the extras inserted.
try:
opts, args = getopt.getopt(sys.argv[1:], 'r:a:dEe:hmo:p:P:b:qs:wX:x:l:')
- except getopt.error, msg:
+ except getopt.error as msg:
usage('getopt error: ' + str(msg))
# process option arguments
@@ -339,7 +339,7 @@ def main():
try:
custom_entry_point, python_entry_is_main = \
winmakemakefile.get_custom_entry_point(subsystem)
- except ValueError, why:
+ except ValueError as why:
usage(why)
diff --git a/ext/python/Tools/freeze/winmakemakefile.py b/ext/python/Tools/freeze/winmakemakefile.py
index e473fed..7d198c1 100644
--- a/ext/python/Tools/freeze/winmakemakefile.py
+++ b/ext/python/Tools/freeze/winmakemakefile.py
@@ -39,7 +39,7 @@ def get_custom_entry_point(subsystem):
try:
return subsystem_details[subsystem][:2]
except KeyError:
- raise ValueError, "The subsystem %s is not known" % subsystem
+ raise ValueError("The subsystem %s is not known" % subsystem)
def makemakefile(outfp, vars, files, target):