Skip to content

Commit

Permalink
[#367] Fixed `DisplayCAL.profile_loader.ProfileLoader._check_display_…
Browse files Browse the repository at this point in the history
…changed()` to use the `REG_QWORD` value directly instead of trying to unpack it as the value is an `int` already.
  • Loading branch information
eoyilmaz committed Oct 9, 2024
1 parent abbfee9 commit 8b882ab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions DisplayCAL/profile_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import ctypes
import math
import re
import struct
import subprocess as sp
import traceback
import warnings
Expand Down Expand Up @@ -2466,9 +2465,9 @@ def _check_display_changed(self, first_run=False, dry_run=False):
try:
display = winreg.QueryValueEx(subkey, "SetId")[0]
value_name = "Timestamp"
timestamp = struct.unpack(
"<Q", winreg.QueryValueEx(subkey, "Timestamp")[0].rjust(8, "0")
)
# winreg.QueryValuesEx will directly return the int value,
# so no need to convert the binary data as in Python2
timestamp = winreg.QueryValueEx(subkey, "Timestamp")[0]
except WindowsError as exception:
warnings.warn(
r"Registry access failed: %s: %s (HKLM\%s\%s)"
Expand Down

0 comments on commit 8b882ab

Please sign in to comment.