Skip to content

Commit 6395754

Browse files
committed
Fix isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections on BSD
Examples: NetBSD: >>> print platform.version() NetBSD 7.99.21 (GENERIC) Bitmessage#1: Sun Sep 13 01:23:14 CEST 2015 root@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC >>> print platform.release() 7.99.21 OpenBSD: >>> print platform.version() GENERIC#738 >>> print platform.release() 5.7 FreeBSD: >>> print platform.version() FreeBSD 11.0-CURRENT #0 r285794: Thu Jul 23 00:39:41 UTC 2015 [email protected]:/usr/obj/arm.armv6/usr/src/sys/RPI2 >>> print platform.release() 11.0-CURRENT
1 parent 72ea076 commit 6395754

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/helper_startup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ def loadConfig():
140140

141141
def isOurOperatingSystemLimitedToHavingVeryFewHalfOpenConnections():
142142
try:
143-
VER_THIS=StrictVersion(platform.version())
144143
if sys.platform[0:3]=="win":
144+
# This check won't work on BSD platforms, replacing it with
145+
# platform.release() still won't be portable, as e.g. FreeBSD might
146+
# return '11.0-CURRENT'. Leave the version check for Windows only.
147+
VER_THIS=StrictVersion(platform.version())
145148
return StrictVersion("5.1.2600")<=VER_THIS and StrictVersion("6.0.6000")>=VER_THIS
146149
return False
147150
except Exception as err:

0 commit comments

Comments
 (0)