From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 36CD8457C4; Wed, 14 Aug 2024 17:05:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6ABA340661; Wed, 14 Aug 2024 17:05:42 +0200 (CEST) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mails.dpdk.org (Postfix) with ESMTP id B157E41132 for ; Wed, 14 Aug 2024 17:05:40 +0200 (CEST) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5ba43b433beso41922a12.1 for ; Wed, 14 Aug 2024 08:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1723647940; x=1724252740; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=goDd0cT5kJTJm2tL6X9YqCyILrUEjQ+gVWVvSRzSF20=; b=lrxLsHUnF1xC1KPaO4Ksg3GjNIFO1EsreegPo8wiEzJQtZU8DoKC8SrUYlGfntzlNf OMdzYvZ49ipbkPc2vU7pn810a0f1lqESjGkIbKf/TMcrVECXtoFTvS8nm8cSz4om9iSm xymHwTJGU6y3U6Yg7TepmqMdm61RuSQoe49kc6bLT40ZY6LJ6/+l2HsDmTfOpRPSF0gx KNPqZXCI+/uCK4KfrNblcovwNjHIqBddQr2LvRqRXf5Uob4V1TIOtchw+PMfLuQGhNlh T3CFL7G8v9YTYuxNszsJivKSzedw+GfJj8tGieV+SdfDFeLoEQdV9h4F0j+maDF7k+NC /5Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723647940; x=1724252740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=goDd0cT5kJTJm2tL6X9YqCyILrUEjQ+gVWVvSRzSF20=; b=iT89m9P+GFjzMw217/4+r/1v7fMIx/jpRABIuqlzgQ45VE1g6nhV3NjJW3uXaFljP6 tM0kIQ944msGW1Dtk9QyuYjEQhHmAsVGxAScYebdAe388g9bey0PP5WTwGIuD15MKZzy J3feCLel7ZQQ6X/VyVW/owVDoQCe3Sy8y04SGSlhROHH8ef7uCAPs8HJr3S8Joo8aoiC 9wK8ukrqurtrhH15Tpb37yuBc57kiWoKsakeMmY+u9NFRAgGqAtWiV5L+MiJbVth8xjA ukh9losz2eKXUw7/UuS3+FGiKwkvUGz0fX2u3cNijJ3etoZ6eAsKzmvB55TdX883hDd6 kZKg== X-Gm-Message-State: AOJu0YyUlX82XD891642Q0HVC6QuTbTpQ9gJSdGddaZnmIDFTwKdDnrJ uQNi78Is3puqOvKAAvmF2+QnMWzOOL6wy/PkTGd9v25tyU+fxfiO2YZhtVIHBLs= X-Google-Smtp-Source: AGHT+IEVYZkveufTfpH48zRUN7obCrx1wUJSL9oh9HXJ0DzMDkLREVjsglv+51XZOUOeyV80LK1qYg== X-Received: by 2002:a05:6402:278c:b0:5a3:f5c6:7cd9 with SMTP id 4fb4d7f45d1cf-5bea1cae090mr2206876a12.26.1723647940005; Wed, 14 Aug 2024 08:05:40 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.pantheon.local ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bd196a7a11sm4009509a12.53.2024.08.14.08.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 08:05:39 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, bruce.richardson@intel.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v17 2/5] dts: replace the or operator in third party types Date: Wed, 14 Aug 2024 17:05:32 +0200 Message-Id: <20240814150535.239547-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240814150535.239547-1-juraj.linkes@pantheon.tech> References: <20231115133606.42081-1-juraj.linkes@pantheon.tech> <20240814150535.239547-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When the DTS dependencies are not installed when building DTS API documentation, the or operator produces errors when used with types from those libraries: autodoc: failed to import module 'remote_session' from module 'framework'; the following exception was raised: Traceback (most recent call last): ... TypeError: unsupported operand type(s) for |: 'Transport' and 'NoneType' The third part type here is Transport from the paramiko library. Signed-off-by: Juraj Linkeš --- dts/framework/remote_session/interactive_remote_session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dts/framework/remote_session/interactive_remote_session.py b/dts/framework/remote_session/interactive_remote_session.py index 97194e6af8..4605ee14b4 100644 --- a/dts/framework/remote_session/interactive_remote_session.py +++ b/dts/framework/remote_session/interactive_remote_session.py @@ -5,6 +5,7 @@ import socket import traceback +from typing import Union from paramiko import AutoAddPolicy, SSHClient, Transport # type: ignore[import-untyped] from paramiko.ssh_exception import ( # type: ignore[import-untyped] @@ -52,7 +53,7 @@ class InteractiveRemoteSession: session: SSHClient _logger: DTSLogger _node_config: NodeConfiguration - _transport: Transport | None + _transport: Union[Transport, None] def __init__(self, node_config: NodeConfiguration, logger: DTSLogger) -> None: """Connect to the node during initialization. -- 2.34.1