daemon/binding/python: show warning if not running on Python 3

This commit is contained in:
Matthias Ringwald 2018-11-28 21:10:06 +01:00
parent a2a10e8d66
commit 5f5762db78

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
from btstack import btstack_server, btstack_client, event_factory
import sys
def packet_handler(packet):
global btstack_client
@ -12,6 +13,11 @@ def packet_handler(packet):
if isinstance(packet, event_factory.GAPEventAdvertisingReport):
print(packet)
# check version
if sys.version_info < (3, 0):
print('BTstack Server Client library, requires Python 3.x or higher.\n')
sys.exit(10)
# Conrtrol for BTstack Server
btstack_server = btstack_server.BTstackServer()