Remove the rgbimg module. It has been deprecated since Python 2.5.
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 0045151..cba70ed 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1337,7 +1337,6 @@
self.expected.add('test_timeout')
if sys.maxint == 9223372036854775807L:
- self.expected.add('test_rgbimg')
self.expected.add('test_imageop')
if not sys.platform in ("mac", "darwin"):
@@ -1352,6 +1351,11 @@
for skip in WIN_ONLY:
self.expected.add(skip)
+ if sys.platform != 'irix':
+ IRIX_ONLY =["test_imageop"]
+ for skip in IRIX_ONLY:
+ self.expected.add(skip)
+
self.valid = True
def isvalid(self):
diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py
index b01e83f..8789c13 100755
--- a/Lib/test/test_imageop.py
+++ b/Lib/test/test_imageop.py
@@ -10,20 +10,13 @@
import imageop, uu, os
import warnings
-warnings.filterwarnings("ignore",
- "the rgbimg module is deprecated",
- DeprecationWarning,
- ".*test_imageop")
-def main(use_rgbimg=1):
+def main():
# Create binary test files
uu.decode(get_qualified_path('testrgb'+os.extsep+'uue'), 'test'+os.extsep+'rgb')
- if use_rgbimg:
- image, width, height = getrgbimage('test'+os.extsep+'rgb')
- else:
- image, width, height = getimage('test'+os.extsep+'rgb')
+ image, width, height = getimage('test'+os.extsep+'rgb')
# Return the selected part of image, which should by width by height
# in size and consist of pixels of psize bytes.
@@ -122,23 +115,6 @@
# Cleanup
unlink('test'+os.extsep+'rgb')
-def getrgbimage(name):
- """return a tuple consisting of image (in 'imgfile' format but
- using rgbimg instead) width and height"""
-
- import rgbimg
-
- try:
- sizes = rgbimg.sizeofimage(name)
- except rgbimg.error:
- name = get_qualified_path(name)
- sizes = rgbimg.sizeofimage(name)
- if verbose:
- print 'rgbimg opening test image: %s, sizes: %s' % (name, str(sizes))
-
- image = rgbimg.longimagedata(name)
- return (image, sizes[0], sizes[1])
-
def getimage(name):
"""return a tuple consisting of
image (in 'imgfile' format) width and height
@@ -172,6 +148,4 @@
return fullname
return name
-# rgbimg (unlike imgfile) is portable to platforms other than SGI.
-# So we prefer to use it.
-main(use_rgbimg=1)
+main()
diff --git a/Lib/test/test_rgbimg.py b/Lib/test/test_rgbimg.py
deleted file mode 100644
index 650c02a..0000000
--- a/Lib/test/test_rgbimg.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Testing rgbimg module
-
-import warnings
-warnings.filterwarnings("ignore",
- "the rgbimg module is deprecated",
- DeprecationWarning,
- ".*test_rgbimg$")
-import rgbimg
-
-import os, uu
-
-from test.test_support import verbose, unlink, findfile
-
-class error(Exception):
- pass
-
-print 'RGBimg test suite:'
-
-def testimg(rgb_file, raw_file):
- rgb_file = findfile(rgb_file)
- raw_file = findfile(raw_file)
- width, height = rgbimg.sizeofimage(rgb_file)
- rgb = rgbimg.longimagedata(rgb_file)
- if len(rgb) != width * height * 4:
- raise error, 'bad image length'
- raw = open(raw_file, 'rb').read()
- if rgb != raw:
- raise error, \
- 'images don\'t match for '+rgb_file+' and '+raw_file
- for depth in [1, 3, 4]:
- rgbimg.longstoimage(rgb, width, height, depth, '@.rgb')
- os.unlink('@.rgb')
-
-table = [
- ('testrgb'+os.extsep+'uue', 'test'+os.extsep+'rgb'),
- ('testimg'+os.extsep+'uue', 'test'+os.extsep+'rawimg'),
- ('testimgr'+os.extsep+'uue', 'test'+os.extsep+'rawimg'+os.extsep+'rev'),
- ]
-for source, target in table:
- source = findfile(source)
- target = findfile(target)
- if verbose:
- print "uudecoding", source, "->", target, "..."
- uu.decode(source, target)
-
-if verbose:
- print "testing..."
-
-ttob = rgbimg.ttob(0)
-if ttob != 0:
- raise error, 'ttob should start out as zero'
-
-testimg('test'+os.extsep+'rgb', 'test'+os.extsep+'rawimg')
-
-ttob = rgbimg.ttob(1)
-if ttob != 0:
- raise error, 'ttob should be zero'
-
-testimg('test'+os.extsep+'rgb', 'test'+os.extsep+'rawimg'+os.extsep+'rev')
-
-ttob = rgbimg.ttob(0)
-if ttob != 1:
- raise error, 'ttob should be one'
-
-ttob = rgbimg.ttob(0)
-if ttob != 0:
- raise error, 'ttob should be zero'
-
-for source, target in table:
- unlink(findfile(target))