# HG changeset patch
# User Antonio Muci <
a....@inwind.it>
# Date 1764794658 -3600
# Wed Dec 03 21:44:18 2025 +0100
# Branch stable
# Node ID 8c15c3614dd846be8951a23a912a24dbf9a97be6
# Parent e6e24115b428ac3bf18e1d342801395d94163334
visdiff: use thread.daemon instead of deprecated Thread.setDaemon()
Before this change, launching thg with:
```
python3.14 -X tracemalloc -Wall ./thg
```
and clicking on a changed file on some past commit would open the visual diff
program, and trigger the following error:
```
<BASE>/tortoisehg/hgqt/visdiff.py:487: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
thread.setDaemon(True)
```
According to documentation at
https://docs.python.org/3.14/library/threading.html#threading.Thread.setDaemon,
the Thread.setDaemon() setter has been deprecated in python 3.10 (oct 2021).
The documentation suggests to "use it directly as a property instead". Indeed,
this gets rid of the warning.
diff --git a/tortoisehg/hgqt/visdiff.py b/tortoisehg/hgqt/visdiff.py
--- a/tortoisehg/hgqt/visdiff.py
+++ b/tortoisehg/hgqt/visdiff.py
@@ -484,7 +484,7 @@ def visual_diff(ui: uimod.ui, repo: loca
# We are not the main application, so this must be done in a
# background thread
thread = threading.Thread(target=dodiff, name='visualdiff')
- thread.setDaemon(True)
+ thread.daemon = True
thread.start()
class FileSelectionDialog(QDialog):