From: 
Subject: Debian changes

The Debian packaging of python-serialx is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/python-serialx
    % cd python-serialx
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone python-serialx`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/Cargo.toml b/Cargo.toml
index 3cce8f1..d59aeea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,12 +8,4 @@ name = "_serialx_rust"
 crate-type = ["cdylib"]
 
 [dependencies]
-pyo3 = { version = "0.23", features = ["extension-module", "abi3-py310"] }
-
-[target.'cfg(target_os = "macos")'.dependencies]
-core-foundation = "0.10"
-core-foundation-sys = "0.8"
-io-kit-sys = "0.4"
-
-[target.'cfg(target_os = "windows")'.dependencies]
-serialport = { version = "4", features = ["usbportinfo-interface"] }
+pyo3 = { version = ">=0.27,<0.29", features = ["extension-module", "abi3-py310"] }
diff --git a/serialx/descriptor_transport.py b/serialx/descriptor_transport.py
index 875fad5..b93eb27 100644
--- a/serialx/descriptor_transport.py
+++ b/serialx/descriptor_transport.py
@@ -80,7 +80,7 @@ class DescriptorTransport(BaseSerialTransport):
         )
 
         try:
-            self._fileno = await self._open_fut
+            self._fileno = await asyncio.shield(self._open_fut)
         except asyncio.CancelledError:
             # `os.open` may still finish in the executor after cancellation. If that
             # happens, close the resulting fd to avoid leaks.
diff --git a/serialx/platforms/serial_win32.py b/serialx/platforms/serial_win32.py
index 52fcae7..637aaad 100644
--- a/serialx/platforms/serial_win32.py
+++ b/serialx/platforms/serial_win32.py
@@ -557,7 +557,7 @@ class Win32SerialTransport(BaseSerialTransport):
         self._open_fut = cast(asyncio.Future[int], open_fut)
 
         try:
-            handle = await self._open_fut
+            handle = await asyncio.shield(self._open_fut)
         except asyncio.CancelledError:
             self._open_fut.add_done_callback(self._on_cancelled_open_done)
             raise
