Skip to content

Commit 72a93ee

Browse files
committed
Test samples_libtcodpy and fix regressions
1 parent d37feea commit 72a93ee

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

examples/samples_libtcodpy.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@
1212
import sys
1313
import warnings
1414

15-
import tcod as libtcod
16-
17-
try: # Import Psyco if available
18-
import psyco
19-
20-
psyco.full()
21-
except ImportError:
22-
pass
15+
from tcod import tcod as libtcod
2316

2417
if not sys.warnoptions:
2518
warnings.simplefilter("ignore") # Prevent flood of deprecation warnings.

tcod/libtcodpy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def bsp_split_once(node: tcod.bsp.BSP, horizontal: bool, position: int) -> None:
546546
@deprecate("Call node.split_recursive instead.", category=FutureWarning)
547547
def bsp_split_recursive(
548548
node: tcod.bsp.BSP,
549-
randomizer: tcod.random.Random | None,
549+
randomizer: Literal[0] | tcod.random.Random | None,
550550
nb: int,
551551
minHSize: int, # noqa: N803
552552
minVSize: int, # noqa: N803
@@ -558,6 +558,8 @@ def bsp_split_recursive(
558558
.. deprecated:: 2.0
559559
Use :any:`BSP.split_recursive` instead.
560560
"""
561+
if randomizer == 0:
562+
randomizer = None
561563
node.split_recursive(nb, minHSize, minVSize, maxHRatio, maxVRatio, randomizer)
562564

563565

0 commit comments

Comments
 (0)