You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2021/11/10 17:30:30 UTC

[libcloud] 06/06: Fix mypy violation.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 2c3e38087e18de9f452e856d10fdf8ccc5c8b926
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Wed Nov 10 18:27:00 2021 +0100

    Fix mypy violation.
---
 libcloud/common/base.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 1881434..074793e 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -630,6 +630,8 @@ class Connection(object):
         try:
             # @TODO: Should we just pass File object as body to request method
             # instead of dealing with splitting and sending the file ourselves?
+            assert self.connection is not None
+
             if raw:
                 self.connection.prepared_request(
                     method=method,
@@ -659,7 +661,7 @@ class Connection(object):
                        '(%s.connection) is set to an invalid, non-hostname '
                        'value (%s)?' %
                        (message, class_name, self.host))
-                raise socket.gaierror(msg)
+                raise socket.gaierror(msg)  # type: ignore
             self.reset_context()
             raise e
         except ssl.SSLError as e: