summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-07-07 13:23:12 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-07-07 19:32:52 +0200
commit230014608571c2ad88b740455f4ffe1b963cad22 (patch)
treeb0a5902ca4e4b2e084a0c4b1dbd48459adc918bd /util
parentQTest: remove unneeded cast in toPrettyUnicode() (diff)
downloadqtbase-230014608571c2ad88b740455f4ffe1b963cad22.tar.xz
qtbase-230014608571c2ad88b740455f4ffe1b963cad22.zip
locale_database: Don't attempt to access property 'message' of IOError
IOError does not have property 'message' in Python 3. Instead of attempting to access it, just use the string representation of the exception object. This produces the error message possibly combined with additional arguments in both Python 2 and Python 3. Task-number: QTBUG-83488 Pick-to: 6.2 Change-Id: Icb198a409e7f80b832e474d8390b770fdeacc6c2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/locale_database/cldr2qtimezone.py4
-rwxr-xr-xutil/locale_database/qlocalexml2cpp.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/util/locale_database/cldr2qtimezone.py b/util/locale_database/cldr2qtimezone.py
index c5eb61c2a8..1e783b6add 100755
--- a/util/locale_database/cldr2qtimezone.py
+++ b/util/locale_database/cldr2qtimezone.py
@@ -363,7 +363,7 @@ def main(args, out, err):
dict((name, ind) for ind, name in enumerate((x[0] for x in windowsIdList), 1)))
except IOError as e:
usage(err, name,
- 'Failed to open common/supplemental/windowsZones.xml: ' + (e.message or e.args[1]))
+ 'Failed to open common/supplemental/windowsZones.xml: ' + str(e))
return 1
except Error as e:
err.write('\n'.join(textwrap.wrap(
@@ -375,7 +375,7 @@ def main(args, out, err):
try:
writer = ZoneIdWriter(dataFilePath, qtPath)
except IOError as e:
- err.write('Failed to open files to transcribe: {}'.format(e.message or e.args[1]))
+ err.write('Failed to open files to transcribe: {}'.format(e))
return 1
try:
diff --git a/util/locale_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py
index 60d0e69228..8194b15755 100755
--- a/util/locale_database/qlocalexml2cpp.py
+++ b/util/locale_database/qlocalexml2cpp.py
@@ -552,7 +552,7 @@ def main(args, out, err):
'qlocale_data_p.h'),
qtsrcdir, reader.cldrVersion)
except IOError as e:
- err.write('Failed to open files to transcribe locale data: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe locale data: ' + str(e))
return 1
try:
@@ -582,7 +582,7 @@ def main(args, out, err):
qtsrcdir, reader.cldrVersion)
except IOError as e:
err.write('Failed to open files to transcribe ' + calendar
- + ' data ' + (e.message or e.args[1]))
+ + ' data ' + str(e))
return 1
try:
@@ -599,7 +599,7 @@ def main(args, out, err):
writer = LocaleHeaderWriter(os.path.join(qtsrcdir, 'src', 'corelib', 'text', 'qlocale.h'),
qtsrcdir, reader.dupes)
except IOError as e:
- err.write('Failed to open files to transcribe qlocale.h: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe qlocale.h: ' + str(e))
return 1
try:
@@ -618,7 +618,7 @@ def main(args, out, err):
writer = Transcriber(os.path.join(qtsrcdir, 'src', 'corelib', 'text', 'qlocale.qdoc'),
qtsrcdir)
except IOError as e:
- err.write('Failed to open files to transcribe qlocale.qdoc: ' + (e.message or e.args[1]))
+ err.write('Failed to open files to transcribe qlocale.qdoc: ' + str(e))
return 1
DOCSTRING = " QLocale's data is based on Common Locale Data Repository "