Skip to content

Commit a2dea43

Browse files
committed
Add minimum pygame version check for #9
1 parent a7d7495 commit a2dea43

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

examples/pygame-basic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
print("""Display HAT Mini: Basic Pygame Demo""")
1212

13+
if pygame.vernum < (3, 0, 0):
14+
print("Need PyGame >= 2.0.0:\n python3 -m pip install pygame --upgrade")
15+
sys.exit(1)
16+
1317

1418
def _exit(sig, frame):
1519
global running

examples/pygame-button-interrupt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
print("""Display HAT Mini: Basic Pygame Demo""")
1313

14+
if pygame.vernum < (2, 0, 0):
15+
print("Need PyGame >= 2.0.0:\n python3 -m pip install pygame --upgrade")
16+
sys.exit(1)
17+
1418

1519
def _exit(sig, frame):
1620
global running

examples/pygame-demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
print("""Display HAT Mini: Pygame Demo""")
1414

15+
if pygame.vernum < (2, 0, 0):
16+
print("Need PyGame >= 2.0.0:\n python3 -m pip install pygame --upgrade")
17+
sys.exit(1)
18+
1519

1620
hue_to_rgb = []
1721

0 commit comments

Comments
 (0)