summaryrefslogtreecommitdiff
blob: 79af5d94bb5983e42c51443401989ace9a84b41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 5d8d85c649b181747d182f676cfd76f843bd61f0 Mon Sep 17 00:00:00 2001
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Sun, 1 Oct 2023 15:08:59 +0530
Subject: [PATCH] Fix compatibility with zeroconf >= 0.73

Fixes #2038 (fix compatibility with newer zeroconf)
---
 src/calibre/devices/smart_device_app/driver.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py
index 87608f305b..b41c3a0063 100644
--- a/src/calibre/devices/smart_device_app/driver.py
+++ b/src/calibre/devices/smart_device_app/driver.py
@@ -2175,6 +2175,8 @@ def monkeypatch_zeroconf():
     # "monkeypatch" zeroconf with a function without the check
     try:
         from zeroconf._utils.name import service_type_name
+        # zeroconf 0.73 uses an lru cache so we need __wrapped__
+        service_type_name = getattr(service_type_name, '__wrapped__', service_type_name)
         service_type_name.__kwdefaults__['strict'] = False
     except ImportError:
         import zeroconf
-- 
2.41.0