Skip to content

Commit

Permalink
#3592 we require int(IntEnum) support
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 26, 2023
1 parent befa4b2 commit af071a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xpra/net/protocol/socket_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# but it works on win32, for whatever that's worth.

import os
from enum import Enum
from enum import Enum, IntEnum
from time import monotonic
from socket import error as socket_error
from threading import Lock, RLock, Event, Thread, current_thread
Expand Down Expand Up @@ -553,11 +553,11 @@ def encode(self, packet_in : PacketType) -> List[NetPacketType]:
item = packet[i]
if item is None:
raise TypeError(f"invalid None value in {packet_type!r} packet at index {i}")
if isinstance(item, IntEnum):
packet[i] = int(item)
continue
if isinstance(item, Enum):
try:
packet[i] = int(item)
except ValueError:
packet[i] = str(item)
packet[i] = str(item)
continue
if isinstance(item, (int, bool, dict, list, tuple)):
continue
Expand Down

0 comments on commit af071a7

Please sign in to comment.