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 5019845769; Thu, 8 Aug 2024 10:55:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC7FD427C3; Thu, 8 Aug 2024 10:54:59 +0200 (CEST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 7DA06427BA for ; Thu, 8 Aug 2024 10:54:57 +0200 (CEST) Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5b8c2a6135dso934317a12.1 for ; Thu, 08 Aug 2024 01:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1723107297; x=1723712097; 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=mft74Wa5gvHOWMFzmNwPQnYe0x6cXyiZFOfK4BukFCuI+Kub1APLGeKuT+g6YCoael u7V4Jz1NUnycr+87qs2L8nUISIq39dIJAcmTbj53MVaasVWYe3T53uD+yvsa78dvbFJc J5CKNCpQfFh8KmZHBfu1bpnga+ftvlAdf21oau1aMVYb433ht+JJ7VXKJIbq92uF6P4G 0rRYEZSGfpVUIEEs31IXrCxsku3NR07K2dEN/M0HUhw384Ta1Wq5vtvz8C2iJe0VizA1 jgl6sFl1dYyziuOlSV9xr+Sk18dsN3BuhQQuRkdF0waI0Y8S2rporNI4Ors/YWujVww9 ZwaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723107297; x=1723712097; 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=C0wem1nc2gvBeYI2GmY7rzo1X7Uq7ZXtq0vW06wZsNeZoYH4NRyfVHr+DJVT781jRi S4HFeI9tev68JNi/BJtSkVvK8g9lMEwetCfnLYWjzFTwcaxy1141Sfsgm2zyGOsVxrh+ Ak6+7cqw4yChGIb2pTJM2rLOjcs24Yr7mT3B2qtxziKeynRkqpmNSwjRFs7VeC1BtqLT EGdjAiC4Jz2Mvccb6G6qbI0+FgeKOOC7AeeNX8kQI8z4R5bOPcVH6TeseJNVRHe+97gq Sfpnbw22bI/f/nF4y23fHH6HqoQnufFp9PS+AV7EBrYTW25mSE5e6iC5LzR+14SPcx+h IDAg== X-Gm-Message-State: AOJu0YwyKd5Pxc7BlAXKnVxdusq2pN3XFwe55h1V4dYrJBu0xW1AEi5H wnZrtaecTaZ3WfNnvH9Al+RJsTz6mdzAl+Oa9Df9VwxaH2d0+V2AEfJFXJgoV7o= X-Google-Smtp-Source: AGHT+IFmSj3xlufVGtqSrMfuLFhYm5A9PgqTYrfLpxqPzurgRTvMZ+X5DISBBxGga9eX0LA1IqMfzw== X-Received: by 2002:a17:907:e66a:b0:a7d:a25b:31be with SMTP id a640c23a62f3a-a8090db1a58mr91280666b.39.1723107296960; Thu, 08 Aug 2024 01:54:56 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.pantheon.local ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9ec8879sm719996266b.211.2024.08.08.01.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 01:54:56 -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 v16 2/5] dts: replace the or operator in third party types Date: Thu, 8 Aug 2024 10:54:49 +0200 Message-Id: <20240808085452.426702-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808085452.426702-1-juraj.linkes@pantheon.tech> References: <20231115133606.42081-1-juraj.linkes@pantheon.tech> <20240808085452.426702-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