Skip to content

Commit

Permalink
Remove RISCOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
Skip Montanaro committed Aug 16, 2007
1 parent c5aba17 commit 7a98be2
Show file tree
Hide file tree
Showing 62 changed files with 106 additions and 3,823 deletions.
5 changes: 1 addition & 4 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.

The name of the operating system dependent module imported. The following names
have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``, ``'os2'``,
``'ce'``, ``'java'``, ``'riscos'``.
``'ce'``, ``'java'``.


.. data:: path
Expand Down Expand Up @@ -1058,9 +1058,6 @@ Files and Directories
On Mac OS systems, the following attributes may also be available:
:attr:`st_rsize`, :attr:`st_creator`, :attr:`st_type`.

On RISCOS systems, the following attributes are also available: :attr:`st_ftype`
(file type), :attr:`st_attrs` (attributes), :attr:`st_obtype` (object type).

.. index:: module: stat

For backward compatibility, the return value of :func:`stat` is also accessible
Expand Down
7 changes: 0 additions & 7 deletions Include/osdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ extern "C" {
#endif
#endif

#ifdef RISCOS
#define SEP '.'
#define MAXPATHLEN 256
#define DELIM ','
#endif


/* Filename separator */
#ifndef SEP
#define SEP '/'
Expand Down
8 changes: 1 addition & 7 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ typedef Py_intptr_t Py_ssize_t;
#define HAVE_FSTAT
#endif

#ifdef RISCOS
#include <sys/types.h>
#include "unixstuff.h"
#endif

#ifdef HAVE_SYS_STAT_H
#if defined(PYOS_OS2) && defined(PYCC_GCC)
#include <sys/types.h>
Expand Down Expand Up @@ -677,8 +672,7 @@ extern double hypot(double, double);
* Hide GCC attributes from compilers that don't support them.
*/
#if (!defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \
!defined(RISCOS)
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) )
#define Py_GCC_ATTRIBUTE(x)
#else
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
Expand Down
5 changes: 1 addition & 4 deletions Lib/distutils/command/install_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@


# Extension for Python source files.
if hasattr(os, 'extsep'):
PYTHON_SOURCE_EXTENSION = os.extsep + "py"
else:
PYTHON_SOURCE_EXTENSION = ".py"
PYTHON_SOURCE_EXTENSION = ".py"

class install_lib (Command):

Expand Down
6 changes: 3 additions & 3 deletions Lib/dumbdbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def __init__(self, filebasename, mode):
# where key is the string key, pos is the offset into the dat
# file of the associated value's first byte, and siz is the number
# of bytes in the associated value.
self._dirfile = filebasename + _os.extsep + 'dir'
self._dirfile = filebasename + '.dir'

# The data file is a binary file pointed into by the directory
# file, and holds the values associated with keys. Each value
# begins at a _BLOCKSIZE-aligned byte offset, and is a raw
# binary 8-bit string value.
self._datfile = filebasename + _os.extsep + 'dat'
self._bakfile = filebasename + _os.extsep + 'bak'
self._datfile = filebasename + '.dat'
self._bakfile = filebasename + '.bak'

# The index is an in-memory dict, mirroring the directory file.
self._index = None # maps keys to (pos, siz) pairs
Expand Down
2 changes: 1 addition & 1 deletion Lib/fileinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def readline(self):
else:
if self._inplace:
self._backupfilename = (
self._filename + (self._backup or os.extsep+"bak"))
self._filename + (self._backup or ".bak"))
try: os.unlink(self._backupfilename)
except os.error: pass
# The next few lines may raise IOError
Expand Down
4 changes: 1 addition & 3 deletions Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- os.curdir is a string representing the current directory ('.' or ':')
- os.pardir is a string representing the parent directory ('..' or '::')
- os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
- os.extsep is the extension separator ('.' or '/')
- os.altsep is the alternate pathname separator (None or '/')
- os.pathsep is the component separator used in $PATH etc
- os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
Expand Down Expand Up @@ -131,8 +130,7 @@ def _get_exports_list(module):
raise ImportError, 'no os specific module found'

sys.modules['os.path'] = path
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
devnull)
from os.path import curdir, pardir, sep, pathsep, defpath, altsep, devnull

del _names

Expand Down
6 changes: 2 additions & 4 deletions Lib/pkgutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,8 @@ def extend_path(path, name):
return path

pname = os.path.join(*name.split('.')) # Reconstitute as relative path
# Just in case os.extsep != '.'
sname = os.extsep.join(name.split('.'))
sname_pkg = sname + os.extsep + "pkg"
init_py = "__init__" + os.extsep + "py"
sname_pkg = name + ".pkg"
init_py = "__init__.py"

path = path[:] # Start with a copy of the existing path

Expand Down
2 changes: 1 addition & 1 deletion Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def addsitedir(sitedir, known_paths=None):
return
names.sort()
for name in names:
if name.endswith(os.extsep + "pth"):
if name.endswith(".pth"):
addpackage(sitedir, name, known_paths)
if reset:
known_paths = None
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS):
names = os.listdir(testdir)
tests = []
for name in names:
if name[:5] == "test_" and name[-3:] == os.extsep+"py":
if name[:5] == "test_" and name[-3:] == ".py":
modname = name[:-3]
if modname not in stdtests and modname not in nottests:
tests.append(modname)
Expand Down Expand Up @@ -799,7 +799,7 @@ def findtestdir():
return testdir

def removepy(name):
if name.endswith(os.extsep + "py"):
if name.endswith(".py"):
name = name[:-3]
return name

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_capi1():
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
self.assertEquals(co.co_name, "test_capi1")
self.assert_(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
self.assert_(co.co_filename.endswith('test_exceptions.py'))
else:
self.fail("Expected exception")

Expand All @@ -167,7 +167,7 @@ def test_capi2():
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
self.assertEquals(co.co_name, "__init__")
self.assert_(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
self.assert_(co.co_filename.endswith('test_exceptions.py'))
co2 = tb.tb_frame.f_back.f_code
self.assertEquals(co2.co_name, "test_capi2")
else:
Expand Down
22 changes: 11 additions & 11 deletions Lib/test/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@


def remove_files(name):
for f in (name + os.extsep + "py",
name + os.extsep + "pyc",
name + os.extsep + "pyo",
name + os.extsep + "pyw",
for f in (name + ".py",
name + ".pyc",
name + ".pyo",
name + ".pyw",
name + "$py.class"):
if os.path.exists(f):
os.remove(f)
Expand All @@ -39,11 +39,11 @@ def testImport(self):
def test_with_extension(ext):
# ext normally ".py"; perhaps ".pyw"
source = TESTFN + ext
pyo = TESTFN + os.extsep + "pyo"
pyo = TESTFN + ".pyo"
if sys.platform.startswith('java'):
pyc = TESTFN + "$py.class"
else:
pyc = TESTFN + os.extsep + "pyc"
pyc = TESTFN + ".pyc"

f = open(source, "w")
print("# This tests Python's ability to import a", ext, "file.", file=f)
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_with_extension(ext):

sys.path.insert(0, os.curdir)
try:
test_with_extension(os.extsep + "py")
test_with_extension(".py")
if sys.platform.startswith("win"):
for ext in ".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw":
test_with_extension(ext)
Expand All @@ -86,7 +86,7 @@ def testImpModule(self):

def test_module_with_large_stack(self, module='longlist'):
# create module w/list of 65000 elements to test bug #561858
filename = module + os.extsep + 'py'
filename = module + '.py'

# create a file with a list of 65000 elements
f = open(filename, 'w+')
Expand All @@ -110,13 +110,13 @@ def test_module_with_large_stack(self, module='longlist'):

# cleanup
del sys.path[-1]
for ext in 'pyc', 'pyo':
fname = module + os.extsep + ext
for ext in '.pyc', '.pyo':
fname = module + ext
if os.path.exists(fname):
os.unlink(fname)

def test_failing_import_sticks(self):
source = TESTFN + os.extsep + "py"
source = TESTFN + ".py"
f = open(source, "w")
print("a = 1/0", file=f)
f.close()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ def createMessage(self, dir, mbox=False):
t = int(time.time() % 1000000)
pid = self._counter
self._counter += 1
filename = os.extsep.join((str(t), str(pid), "myhostname", "mydomain"))
filename = ".".join((str(t), str(pid), "myhostname", "mydomain"))
tmpname = os.path.join(self._dir, "tmp", filename)
newname = os.path.join(self._dir, dir, filename)
fp = open(tmpname, "w")
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
base = sys.argv[0]
else:
base = __file__
tstfile = os.path.join(os.path.dirname(base), "test"+os.extsep+"xml")
tstfile = os.path.join(os.path.dirname(base), "test.xml")
del base

# The tests of DocumentType importing use these helpers to construct
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
from unicodedata import normalize

TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/4.1.0/ucd/" + TESTDATAFILE

class RangeError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_old_mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def createMessage(self, dir, mbox=False):
t = int(time.time() % 1000000)
pid = self._counter
self._counter += 1
filename = os.extsep.join((str(t), str(pid), "myhostname", "mydomain"))
filename = ".".join((str(t), str(pid), "myhostname", "mydomain"))
tmpname = os.path.join(self._dir, "tmp", filename)
newname = os.path.join(self._dir, dir, filename)
fp = open(tmpname, "w")
Expand Down
54 changes: 27 additions & 27 deletions Lib/test/test_pkg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test packages (dotted-name import)

import sys, os, tempfile, traceback
from os import mkdir, rmdir, extsep # Can't test if these fail
from os import mkdir, rmdir # Can't test if these fail
del mkdir, rmdir
from test.test_support import verify, verbose, TestFailed

Expand Down Expand Up @@ -77,15 +77,15 @@ def runtest(hier, code):
# Test descriptions

tests = [
("t1", [("t1", None), ("t1 __init__"+os.extsep+"py", "")], "import t1"),
("t1", [("t1", None), ("t1 __init__.py", "")], "import t1"),

("t2", [
("t2", None),
("t2 __init__"+os.extsep+"py", "'doc for t2'; print(__name__, 'loading')"),
("t2 __init__.py", "'doc for t2'; print(__name__, 'loading')"),
("t2 sub", None),
("t2 sub __init__"+os.extsep+"py", ""),
("t2 sub __init__.py", ""),
("t2 sub subsub", None),
("t2 sub subsub __init__"+os.extsep+"py", "print(__name__, 'loading'); spam = 1"),
("t2 sub subsub __init__.py", "print(__name__, 'loading'); spam = 1"),
],
"""
import t2
Expand All @@ -111,27 +111,27 @@ def runtest(hier, code):

("t3", [
("t3", None),
("t3 __init__"+os.extsep+"py", "print(__name__, 'loading')"),
("t3 __init__.py", "print(__name__, 'loading')"),
("t3 sub", None),
("t3 sub __init__"+os.extsep+"py", ""),
("t3 sub __init__.py", ""),
("t3 sub subsub", None),
("t3 sub subsub __init__"+os.extsep+"py", "print(__name__, 'loading'); spam = 1"),
("t3 sub subsub __init__.py", "print(__name__, 'loading'); spam = 1"),
],
"""
import t3.sub.subsub
print(t3.__name__, t3.sub.__name__, t3.sub.subsub.__name__)
"""),

("t4", [
("t4"+os.extsep+"py", "print('THIS SHOULD NOT BE PRINTED (t4"+os.extsep+"py)')"),
("t4.py", "print('THIS SHOULD NOT BE PRINTED (t4.py)')"),
("t4", None),
("t4 __init__"+os.extsep+"py", "print(__name__, 'loading')"),
("t4 sub"+os.extsep+"py", "print('THIS SHOULD NOT BE PRINTED (sub"+os.extsep+"py)')"),
("t4 __init__.py", "print(__name__, 'loading')"),
("t4 sub.py", "print('THIS SHOULD NOT BE PRINTED (sub.py)')"),
("t4 sub", None),
("t4 sub __init__"+os.extsep+"py", ""),
("t4 sub subsub"+os.extsep+"py", "print('THIS SHOULD NOT BE PRINTED (subsub"+os.extsep+"py)')"),
("t4 sub __init__.py", ""),
("t4 sub subsub.py", "print('THIS SHOULD NOT BE PRINTED (subsub.py)')"),
("t4 sub subsub", None),
("t4 sub subsub __init__"+os.extsep+"py", "print(__name__, 'loading'); spam = 1"),
("t4 sub subsub __init__.py", "print(__name__, 'loading'); spam = 1"),
],
"""
from t4.sub.subsub import *
Expand All @@ -140,9 +140,9 @@ def runtest(hier, code):

("t5", [
("t5", None),
("t5 __init__"+os.extsep+"py", "import t5.foo"),
("t5 string"+os.extsep+"py", "print(__name__, 'loading'); spam = 1"),
("t5 foo"+os.extsep+"py",
("t5 __init__.py", "import t5.foo"),
("t5 string.py", "print(__name__, 'loading'); spam = 1"),
("t5 foo.py",
"print(__name__, 'loading'); from . import string; print(string.spam)"),
],
"""
Expand All @@ -157,10 +157,10 @@ def runtest(hier, code):

("t6", [
("t6", None),
("t6 __init__"+os.extsep+"py", "__all__ = ['spam', 'ham', 'eggs']"),
("t6 spam"+os.extsep+"py", "print(__name__, 'loading')"),
("t6 ham"+os.extsep+"py", "print(__name__, 'loading')"),
("t6 eggs"+os.extsep+"py", "print(__name__, 'loading')"),
("t6 __init__.py", "__all__ = ['spam', 'ham', 'eggs']"),
("t6 spam.py", "print(__name__, 'loading')"),
("t6 ham.py", "print(__name__, 'loading')"),
("t6 eggs.py", "print(__name__, 'loading')"),
],
"""
import t6
Expand All @@ -171,15 +171,15 @@ def runtest(hier, code):
"""),

("t7", [
("t7"+os.extsep+"py", "print('Importing t7"+os.extsep+"py')"),
("t7.py", "print('Importing t7.py')"),
("t7", None),
("t7 __init__"+os.extsep+"py", "print(__name__, 'loading')"),
("t7 sub"+os.extsep+"py", "print('THIS SHOULD NOT BE PRINTED (sub"+os.extsep+"py)')"),
("t7 __init__.py", "print(__name__, 'loading')"),
("t7 sub.py", "print('THIS SHOULD NOT BE PRINTED (sub.py)')"),
("t7 sub", None),
("t7 sub __init__"+os.extsep+"py", ""),
("t7 sub subsub"+os.extsep+"py", "print('THIS SHOULD NOT BE PRINTED (subsub"+os.extsep+"py)')"),
("t7 sub __init__.py", ""),
("t7 sub subsub.py", "print('THIS SHOULD NOT BE PRINTED (subsub.py)')"),
("t7 sub subsub", None),
("t7 sub subsub __init__"+os.extsep+"py", "print(__name__, 'loading'); spam = 1"),
("t7 sub subsub __init__.py", "print(__name__, 'loading'); spam = 1"),
],
"""
t7, sub, subsub = None, None, None
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_pkgimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def setUp(self):
self.package_dir = os.path.join(self.test_dir,
self.package_name)
os.mkdir(self.package_dir)
open(os.path.join(self.package_dir, '__init__'+os.extsep+'py'), 'w')
self.module_path = os.path.join(self.package_dir, 'foo'+os.extsep+'py')
open(os.path.join(self.package_dir, '__init__.py'), 'w')
self.module_path = os.path.join(self.package_dir, 'foo.py')

def tearDown(self):
for file in os.listdir(self.package_dir):
Expand Down
Loading

0 comments on commit 7a98be2

Please sign in to comment.