mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 16:03:57 +01:00
Fix python2 client compatibility
Python2 ignores the byte string qualification (b’foo’) but falls over for the combination rb for this regexp. Switching the qualification to br appears to fix this and works in both python2 and python3.
This commit is contained in:
parent
f23510a4fc
commit
ec5fb68350
@ -299,8 +299,8 @@ class FirewallClient:
|
|||||||
raise Fatal('%r expected STARTED, got %r' % (self.argv, line))
|
raise Fatal('%r expected STARTED, got %r' % (self.argv, line))
|
||||||
|
|
||||||
def sethostip(self, hostname, ip):
|
def sethostip(self, hostname, ip):
|
||||||
assert(not re.search(rb'[^-\w\.]', hostname))
|
assert(not re.search(br'[^-\w\.]', hostname))
|
||||||
assert(not re.search(rb'[^0-9.]', ip))
|
assert(not re.search(br'[^0-9.]', ip))
|
||||||
self.pfile.write(b'HOST %s,%s\n' % (hostname, ip))
|
self.pfile.write(b'HOST %s,%s\n' % (hostname, ip))
|
||||||
self.pfile.flush()
|
self.pfile.flush()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user