Skip to content

Commit

Permalink
Fix WindowState error in PySide6 v6.4
Browse files Browse the repository at this point in the history
PySide6 converts QEnum to a Python enum, but it's not recognised by
'isinstance'.
  • Loading branch information
jim-easterbrook committed Oct 21, 2022
1 parent 08b9228 commit 1fe672f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/photini/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Full documentation is at https://photini.readthedocs.io/"""

__version__ = '2022.10.0.1'
build = '2277 (6da9860)'
__version__ = '2022.10.0.2'
build = '2278 (08b9228)'
5 changes: 2 additions & 3 deletions src/photini/pyqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from collections import namedtuple
from contextlib import contextmanager
import enum
from functools import wraps
import importlib
import logging
Expand Down Expand Up @@ -280,8 +279,8 @@ def execute(widget, *arg, **kwds):
return widget.exec(*arg, **kwds)

def flag_to_int(flags):
if isinstance(flags, enum.Enum):
# PySide6 started using Python enum for QFlags in v6.4
if hasattr(flags, 'value'):
# recent versions of PyQt6 and PySide6 convert QEnum to Python enum
return flags.value
return int(flags)

Expand Down
4 changes: 2 additions & 2 deletions utils/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def main(argv=None):
for tag in repo.tags:
if tag.commit.committed_date > latest:
tag_name = str(tag)
if re.match(r'\d{4}\.\d{1,2}\.\d$', tag_name):
if re.match(r'\d{4}\.\d{1,2}\.\d', tag_name):
latest = tag.commit.committed_date
last_release = tag_name
# set current version number (calendar based)
# set current version number
last_release = [int(x) for x in last_release.split('.')]
major, minor, micro = last_release[:3]
version = [int(x) for x in __version__.split('.')]
Expand Down

0 comments on commit 1fe672f

Please sign in to comment.