Skip to content

Commit

Permalink
Fix local variable 'version_server' referenced before assignment
Browse files Browse the repository at this point in the history
```
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/twisted/python/log.py", line 96, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python3.9/site-packages/twisted/python/log.py", line 80, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python3.9/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.9/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
--- <exception caught here> ---
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/posixbase.py", line 487, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/tcp.py", line 248, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python3.9/site-packages/twisted/internet/tcp.py", line 253, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/local/lib/python3.9/site-packages/twisted/protocols/tls.py", line 329, in dataReceived
    self._flushReceiveBIO()
  File "/usr/local/lib/python3.9/site-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
    ProtocolWrapper.dataReceived(self, bytes)
  File "/usr/local/lib/python3.9/site-packages/twisted/protocols/policies.py", line 110, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "/usr/local/lib/python3.9/site-packages/rmview/rfb.py", line 722, in dataReceived
    self._handler()
  File "/usr/local/lib/python3.9/site-packages/rmview/rfb.py", line 195, in _handleInitial
    version = version_server
```
  • Loading branch information
adoy committed Dec 2, 2022
1 parent 9a48de1 commit f9104f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rmview/rfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def _handleInitial(self):
buffer = b''.join(self._packet)
if b'\n' in buffer:
version = 3.8
version_server = 3.8
if buffer[:3] == b'RFB':
version_server = float(buffer[3:-1].replace(b'0', b''))
SUPPORTED_VERSIONS = (3.3, 3.7, 3.8)
Expand Down

0 comments on commit f9104f0

Please sign in to comment.