Skip to content

Commit

Permalink
Fix unsupported wurlitzer on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kinuax committed May 7, 2024
1 parent 4187dcb commit ad884c7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rolabesti/views/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import contextlib
from contextlib import contextmanager, redirect_stdout
from pathlib import Path
from wurlitzer import pipes

try:
from wurlitzer import pipes
except ModuleNotFoundError:
# wurlitzer is not supported on Windows.
@contextmanager
def pipes():
yield


# Avoid messages from pygame while importing.
with contextlib.redirect_stdout(None):
with redirect_stdout(None):
import pygame


Expand Down

0 comments on commit ad884c7

Please sign in to comment.