summaryrefslogtreecommitdiff
path: root/pygst.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'pygst.py.in')
-rw-r--r--pygst.py.in16
1 files changed, 11 insertions, 5 deletions
diff --git a/pygst.py.in b/pygst.py.in
index e2ed71e56c..36a93ee49a 100644
--- a/pygst.py.in
+++ b/pygst.py.in
@@ -1,5 +1,5 @@
# -*- Mode: Python; py-indent-offset: 4 -*-
-# pygtk - Python bindings for the GTK+ widget set.
+# pygst - Python bindings for the GStreamer multimedia framework.
# Copyright (C) 1998-2002 James Henstridge
# (C) 2005 Edward Hervey
#
@@ -34,19 +34,25 @@ _pygst_version = '@GST_MAJORMINOR@'
_pygst_required_version = None
+class RequiredVersionError(ValueError, AssertionError):
+ # AssertionError is subclassed for compatibility reasons.
+ pass
+
+
def require(version):
global _pygst_required_version
if _pygst_required_version != None:
if _pygst_required_version != version:
- raise StandardError, "a different version of gst was already required"
- return
+ raise RequiredVersionError, "a different version of gst was already required"
+ else:
+ return
if sys.modules.has_key('gst'):
- raise StandardError, "pygst.require() must be called before importing gst"
+ raise RequiredVersionError, "pygst.require() must be called before importing gst"
if version != _pygst_version:
- raise StandardError, "Only version '%s' is available" % _pygst_version
+ raise RequiredVersionError, "Only version '%s' is available" % _pygst_version
# move the pygst path to the front
while _pygst_dir in sys.path: