Преглед изворни кода

Don't put important code in an assert - fixes media player sample in runtime environment

rdb пре 10 година
родитељ
комит
9053999889
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      samples/media-player/main.py

+ 2 - 1
samples/media-player/main.py

@@ -38,7 +38,8 @@ class MediaPlayer(ShowBase):
         # but we want to make sure we get a MovieTexture, since it
         # implements synchronizeTo.
         self.tex = MovieTexture("name")
-        assert self.tex.read(media_file), "Failed to load video!"
+        success = self.tex.read(media_file)
+        assert success, "Failed to load video!"
 
         # Set up a fullscreen card to set the video texture on.
         cm = CardMaker("My Fullscreen Card")