aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/optionparser.py
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2022-05-25 14:14:19 +0300
committerPatrik Teivonen <patrik.teivonen@qt.io>2022-08-05 09:33:47 +0000
commit506b1fe037a1b4fd6f3aec7862ca3fa2ea35006b (patch)
treeb0ff3247aa5b4f5081c17149b9463ea6fcef8636 /packaging-tools/optionparser.py
parent6099b89f35499c60eb0ed4be10e40966326ea678 (diff)
Make imports consistent across Python scripts, isort hookv6.4.0-beta3-packaging
-Add isort to Pipfile, isort hook with blackformatter profile -Fix imports in unittest hook -Group and sort imports by their category (PEP8) -Blank line between import groups (PEP8) -Move all imports to toplevel (PEP8) -Don't unnecessarily append to sys.path (PEP8) -Import only required functions (this also helps reduce line length) -Update deprecated imports such as builtins.WindowsError, ConfigParser.readfp -Remove Python 2, cyclic and unused imports -Fix platform dependent imports and remove unnecessaty try-excepts -Remove unnecessary comments before imports, use in-line comments when needed -Rename conflicting functions in imports, variables as absolute imports are recommended (PEP8) Change-Id: I5ac7a3499ea47a6bdc9a9a2b5211841f65c011ea Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
Diffstat (limited to 'packaging-tools/optionparser.py')
-rw-r--r--packaging-tools/optionparser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/packaging-tools/optionparser.py b/packaging-tools/optionparser.py
index 650efc3c5..853a826e7 100644
--- a/packaging-tools/optionparser.py
+++ b/packaging-tools/optionparser.py
@@ -28,10 +28,10 @@
# $QT_END_LICENSE$
#
#############################################################################
-from configparser import ConfigParser
import argparse
import os
import sys
+from configparser import ConfigParser
class PackagingOptions:
@@ -39,7 +39,7 @@ class PackagingOptions:
def __init__(self, confFile):
if not os.path.isfile(confFile):
raise IOError("Not a valid file: {0}".format(confFile))
- self.config = ConfigParser.ConfigParser(os.environ)
+ self.config = ConfigParser(os.environ)
self.config.optionxform = str
self.config.read(confFile)