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 B21C845822; Tue, 20 Aug 2024 15:18:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BBCB40B9A; Tue, 20 Aug 2024 15:18:27 +0200 (CEST) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mails.dpdk.org (Postfix) with ESMTP id E7485402BD for ; Tue, 20 Aug 2024 15:18:24 +0200 (CEST) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5bef295a429so2904604a12.2 for ; Tue, 20 Aug 2024 06:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1724159904; x=1724764704; 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=lCxXgxtighU0iVfw6bUSE5XGZbDwRnXB01YsMQJPvAA=; b=DMtSa51ZFrCjAq7yQ7iTLv4Ue2YudD7PebeOO4tIXDnoNA93mFlU7ZslebXhDflY2o VzvrjEWK2j9gvrw78xDlagZ1Y3P9itvwjDIFVtWAnpQkz4SvnvxwwtXOSKKGd5CgGpU3 lTKU7qjmsam3fupo9CAlu2aiSnuz7tVbbz87EQel0kdY9gyt4fTAHsZY8M7PGrv4Ni+O 54C0eh9vI4InIG+/u/UxH02CgPQJ46mjIAXivSnrrzuHKKnWdNtTnx6CBCfVwgUMzkjQ qv3kY+Km9CMlLzuCb7MTkJP3NVzvHVkD7meIda31DrED2q6QDWLrZKsK15EG+LStSQT2 oo3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724159904; x=1724764704; 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=lCxXgxtighU0iVfw6bUSE5XGZbDwRnXB01YsMQJPvAA=; b=CG4oZS0N5zIswJ4BktHXy10extm42KXUbMsiohnM91NdDrH4a+sqAQZNAURa+vuQqQ yYn6azx0W+mdGj83eLGIJrNpaxZT+0RyPBRH/JOW+fP0dzS8y7RNZgmwgJk4Qe1GO6rT ieCoMr/MKpAb89wnABuX5guzhYsz0dL9pxN5IwgqaZbBO6CotHKZGzuxrAy8Ko9Op2Py KbQ1/crYJzTSS7IExt+KRzRJZIb89ykMcwsrmJbqfCLiK5C6FOOA433grOAwAIiftZRx K6naHbDw5cm2p/EotZalIKITT6fZdCc/1G0vea9/Vd6ORzO6/5QZ5Jdwzt4QjxDTuwNf 5maA== X-Gm-Message-State: AOJu0YxGI4kVyJeBvLyP98YWW4vONQEsgeucqrF2X6ff53Vj8esdO+MF rByPCPUbNM+QIh6gAYexoIH9gFqN3i0PX8hkZ82MtSy273yeGHEMHfwGdYnj69M= X-Google-Smtp-Source: AGHT+IEIuWfnTZscCJkGjyuqTv/50wEj/VnX9n3K/Qgp5tob4SAbpW4PTdB1iwgsTWP6n9IJ2jbATQ== X-Received: by 2002:a05:6402:35cd:b0:5be:bcdf:40ea with SMTP id 4fb4d7f45d1cf-5bf0d1a1853mr1933501a12.9.1724159904488; Tue, 20 Aug 2024 06:18:24 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.pantheon.local ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbdfb7aasm6779073a12.51.2024.08.20.06.18.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 06:18:24 -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 v18 2/5] dts: replace the or operator in third party types Date: Tue, 20 Aug 2024 15:18:16 +0200 Message-Id: <20240820131819.242016-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240820131819.242016-1-juraj.linkes@pantheon.tech> References: <20231115133606.42081-1-juraj.linkes@pantheon.tech> <20240820131819.242016-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š Reviewed-by: Jeremy Spewock --- 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