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 355A54574A; Tue, 6 Aug 2024 13:18:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ADD542E44; Tue, 6 Aug 2024 13:18:02 +0200 (CEST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mails.dpdk.org (Postfix) with ESMTP id EC91542DDE for ; Tue, 6 Aug 2024 13:17:59 +0200 (CEST) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5a156557029so612955a12.2 for ; Tue, 06 Aug 2024 04:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1722943079; x=1723547879; 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=guuC9XdEC/1Xd9TOnMshjWuTvoRgp/O0ZJR/a4werNqfniNYh60FssLVDvENTsP3uC q6GApLCmr3vQZwx8K0DQvzOE4oaCU9JYcQDxznOMle143TCq8Qxi4rdhNLnlQd/RUwBH GcWjQksTOotvrBTP/iAwz+zhTTD6EJpVNEN9L0OFmXmKRnYkhaNq+CbUpVRhNDKXG76H BNFbNMMmje5dpGkmw+3JjCzK86fwckj5FsI7Ugu18s76UhI7oADhre750m/n/xbduwMt k7DILo/7ZJ90GbBRixnx77KJCW8uaMnGtNrds3yRA3R2iDGJ0NYytm/fAAXjirln4XUZ YBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722943079; x=1723547879; 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=vxi8zqw8GWZZEfg8NtHkby1A/Zqn6DzTtHcVl1Tl99YOLNOt8KR0Uos6ynnengbiSe ekvuLZT32fGW3a6c8YnbDaGrZSlz9OJKYKPjftCn0AdmcfkFpW/sZ4VCL4Daq9HNXmCT 1E+ngJC3nIbQSFmjrGMrci3FGNZU11AOGjQ32W7TDOgz5n7wYymL0jwa/g03/c8CVWrg 3gpwFdtjUOHjw0JEQuEoXl9WgeVk+OHklPbpaLzbaCdUypRhJdX6AMYiuwod8PTH8cGn VxahiE8U/bQtbBnxFVZTEDQmRoyG613br1xlMj5oj7patGgecNI/mP8iEAI67IghwkpQ 9LSg== X-Gm-Message-State: AOJu0YxxBGrAiTSQ9ihw4GX+OCUsyMNV+PLRomm6GsFqWc44AwWZAMRf CpIvD3lkHVSaZf1y3dgSAZtAjA7dunKhqGaxepjYFlxqFp12wzxkjgrlO2oA43s= X-Google-Smtp-Source: AGHT+IGdwdRgQo70yQmsv1g50WEiy2cI0HxqEyfrE51a+5XRzfr1jrSdbBxPSICPMV+FEe0/S1GxLw== X-Received: by 2002:a05:6402:347:b0:5a1:7362:91d9 with SMTP id 4fb4d7f45d1cf-5b7f4295cddmr9711957a12.22.1722943079491; Tue, 06 Aug 2024 04:17:59 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.pantheon.local (81.89.53.154.host.vnet.sk. [81.89.53.154]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bb885c8b57sm2624520a12.96.2024.08.06.04.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Aug 2024 04:17:58 -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 v14 2/6] dts: replace the or operator in third party types Date: Tue, 6 Aug 2024 13:17:52 +0200 Message-Id: <20240806111756.314055-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806111756.314055-1-juraj.linkes@pantheon.tech> References: <20231115133606.42081-1-juraj.linkes@pantheon.tech> <20240806111756.314055-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