wormhole: slightly different way to unicode-encode the version

(this is somewhat more in line with how this distinction is made elsewhere in
the code)
This commit is contained in:
Brian Warner 2018-04-03 17:10:46 -07:00
parent 0dd3a12546
commit 5c84f6a373

View File

@ -231,10 +231,10 @@ def create(appid, relay_url, reactor, # use keyword args for everything else
w = _DeferredWormhole(eq) w = _DeferredWormhole(eq)
wormhole_versions = {} # will be used to indicate Wormhole capabilities wormhole_versions = {} # will be used to indicate Wormhole capabilities
wormhole_versions["app_versions"] = versions # app-specific capabilities wormhole_versions["app_versions"] = versions # app-specific capabilities
if type(__version__) == str: v = __version__
client_version = ("python", __version__) if isinstance(v, type(b"")):
else: v = v.decode("utf-8", errors="replace")
client_version = ("python", __version__.decode("utf-8", errors="replace")) client_version = ("python", v)
b = Boss(w, side, relay_url, appid, wormhole_versions, client_version, b = Boss(w, side, relay_url, appid, wormhole_versions, client_version,
reactor, journal, tor, timing) reactor, journal, tor, timing)
w._set_boss(b) w._set_boss(b)