forked from platformio/platformio-core
Use PY3 super() zero-argument syntax
This commit is contained in:
1 parent
eaff7f307c
commit
5a0a215bfc
35 files changed
+67
-79
No files matched your search
@@ -22,7 +22,7 @@ class PlatformioCLI(click.MultiCommand):
|
||||
leftover_args = []
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PlatformioCLI, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._pio_cmds_dir = os.path.dirname(__file__)
|
||||
|
||||
@staticmethod
|
||||
@@ -41,7 +41,7 @@ class PlatformioCLI(click.MultiCommand):
|
||||
PlatformioCLI.leftover_args = ctx.args
|
||||
if hasattr(ctx, "protected_args"):
|
||||
PlatformioCLI.leftover_args = ctx.protected_args + ctx.args
|
||||
return super(PlatformioCLI, self).invoke(ctx)
|
||||
return super().invoke(ctx)
|
||||
|
||||
def list_commands(self, ctx):
|
||||
cmds = []
|
||||
|
||||
@@ -23,7 +23,7 @@ from platformio.commands.check.tools.base import CheckToolBase
|
||||
|
||||
class CppcheckCheckTool(CheckToolBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CppcheckCheckTool, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._field_delimiter = "<&PIO&>"
|
||||
self._buffer = ""
|
||||
self.defect_fields = [
|
||||
@@ -207,7 +207,7 @@ class CppcheckCheckTool(CheckToolBase):
|
||||
return self._create_tmp_file("\n".join(result))
|
||||
|
||||
def clean_up(self):
|
||||
super(CppcheckCheckTool, self).clean_up()
|
||||
super().clean_up()
|
||||
|
||||
# delete temporary dump files generated by addons
|
||||
if not self.is_flag_set("--addon", self.get_flags("cppcheck")):
|
||||
|
||||
@@ -27,7 +27,7 @@ from platformio.compat import IS_WINDOWS
|
||||
|
||||
class PvsStudioCheckTool(CheckToolBase): # pylint: disable=too-many-instance-attributes
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PvsStudioCheckTool, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._tmp_dir = tempfile.mkdtemp(prefix="piocheck")
|
||||
self._tmp_preprocessed_file = self._generate_tmp_file_path() + ".i"
|
||||
self._tmp_output_file = self._generate_tmp_file_path() + ".pvs"
|
||||
@@ -208,7 +208,7 @@ class PvsStudioCheckTool(CheckToolBase): # pylint: disable=too-many-instance-at
|
||||
self._bad_input = True
|
||||
|
||||
def clean_up(self):
|
||||
super(PvsStudioCheckTool, self).clean_up()
|
||||
super().clean_up()
|
||||
if os.path.isdir(self._tmp_dir):
|
||||
shutil.rmtree(self._tmp_dir)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Hexlify(DeviceMonitorFilter):
|
||||
NAME = "hexlify"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Hexlify, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._counter = 0
|
||||
|
||||
def rx(self, text):
|
||||
|
||||
@@ -23,7 +23,7 @@ class LogToFile(DeviceMonitorFilter):
|
||||
NAME = "log2file"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(LogToFile, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._log_fp = None
|
||||
|
||||
def __call__(self):
|
||||
|
||||
@@ -19,7 +19,7 @@ class SendOnEnter(DeviceMonitorFilter):
|
||||
NAME = "send_on_enter"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SendOnEnter, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._buffer = ""
|
||||
|
||||
if self.options.get("eol") == "CR":
|
||||
|
||||
@@ -21,7 +21,7 @@ class Timestamp(DeviceMonitorFilter):
|
||||
NAME = "time"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Timestamp, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._line_started = False
|
||||
|
||||
def rx(self, text):
|
||||
|
||||
@@ -26,7 +26,7 @@ class AsyncSession(requests.Session):
|
||||
async def request( # pylint: disable=signature-differs,invalid-overridden-method
|
||||
self, *args, **kwargs
|
||||
):
|
||||
func = super(AsyncSession, self).request
|
||||
func = super().request
|
||||
return await run_in_threadpool(func, *args, **kwargs)
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class ProjectSyncAsyncCmd(AsyncCommandBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.psync = None
|
||||
self._upstream = None
|
||||
super(ProjectSyncAsyncCmd, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def start(self):
|
||||
project_dir = os.path.join(
|
||||
|
||||
@@ -23,7 +23,7 @@ class SSLContextFactory(ssl.ClientContextFactory):
|
||||
self.certificate_verified = False
|
||||
|
||||
def getContext(self):
|
||||
ctx = super(SSLContextFactory, self).getContext()
|
||||
ctx = super().getContext()
|
||||
ctx.set_verify(
|
||||
SSL.VERIFY_PEER | SSL.VERIFY_FAIL_IF_NO_PEER_CERT, self.verifyHostname
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user