Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a94568a

Browse files
committed
Patch #734231: Update RiscOS support. In particular, correct
riscospath.extsep, and use os.extsep throughout.
1 parent 5467d4c commit a94568a

27 files changed

Lines changed: 482 additions & 59 deletions

Include/pyport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ typedef PY_LONG_LONG Py_intptr_t;
147147

148148
#ifdef RISCOS
149149
#include <sys/types.h>
150+
#include "unixstuff.h"
150151
#endif
151152

152153
#ifndef DONT_HAVE_SYS_STAT_H

Lib/plat-riscos/riscospath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# strings representing various path-related bits and pieces
1616
curdir = '@'
1717
pardir = '^'
18-
extsep = '.'
18+
extsep = '/'
1919
sep = '.'
2020
pathsep = ','
2121
defpath = '<Run$Dir>'

Lib/site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def addpackage(sitedir, name):
162162
prefixes.append(sys.exec_prefix)
163163
for prefix in prefixes:
164164
if prefix:
165-
if sys.platform == 'os2emx':
165+
if sys.platform in ('os2emx', 'riscos'):
166166
sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
167167
elif os.sep == '/':
168168
sitedirs = [os.path.join(prefix,

Lib/socket.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def ssl(sock, keyfile=None, certfile=None):
9696
errorTab[10065] = "The host is unreachable."
9797
__all__.append("errorTab")
9898

99-
del os, sys
10099

101100

102101
def getfqdn(name=''):
@@ -139,6 +138,9 @@ def getfqdn(name=''):
139138
'sendall', 'setblocking',
140139
'settimeout', 'gettimeout', 'shutdown')
141140

141+
if sys.platform == "riscos":
142+
_socketmethods = _socketmethods + ('sleeptaskw',)
143+
142144
class _closedsocket(object):
143145
__slots__ = []
144146
def _dummy(*args):

Lib/test/regrtest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,10 @@ def printlist(x, width=70, indent=4):
726726
"""
727727
test_al
728728
test_asynchat
729+
test_atexit
729730
test_bsddb
730731
test_bsddb185
732+
test_bsddb3
731733
test_cd
732734
test_cl
733735
test_commands

Lib/test/test_bz2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import bz2
1212
from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
1313

14-
has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx")
14+
has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx", "riscos")
1515

1616
class BaseTest(unittest.TestCase):
1717
"Base for other testcases."

Lib/test/test_exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from test.test_support import TestFailed, TESTFN, unlink
44
from types import ClassType
55
import warnings
6-
import sys, traceback
6+
import sys, traceback, os
77

88
print '5. Built-in exceptions'
99
# XXX This is not really enough, each *operation* should be tested!
@@ -185,7 +185,7 @@ def test_capi1():
185185
exc, err, tb = sys.exc_info()
186186
co = tb.tb_frame.f_code
187187
assert co.co_name == "test_capi1"
188-
assert co.co_filename.endswith('test_exceptions.py')
188+
assert co.co_filename.endswith('test_exceptions'+os.extsep+'py')
189189
else:
190190
print "Expected exception"
191191

@@ -197,7 +197,7 @@ def test_capi2():
197197
exc, err, tb = sys.exc_info()
198198
co = tb.tb_frame.f_code
199199
assert co.co_name == "__init__"
200-
assert co.co_filename.endswith('test_exceptions.py')
200+
assert co.co_filename.endswith('test_exceptions'+os.extsep+'py')
201201
co2 = tb.tb_frame.f_back.f_code
202202
assert co2.co_name == "test_capi2"
203203
else:

Lib/test/test_import.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_with_extension(ext): # ext normally ".py"; perhaps ".pyw"
7878

7979
def test_module_with_large_stack(module):
8080
# create module w/list of 65000 elements to test bug #561858
81-
filename = module + '.py'
81+
filename = module + os.extsep + 'py'
8282

8383
# create a file with a list of 65000 elements
8484
f = open(filename, 'w+')
@@ -102,8 +102,8 @@ def test_module_with_large_stack(module):
102102

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

Lib/test/test_normalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from unicodedata import normalize
55

6-
TESTDATAFILE = "NormalizationTest.txt"
6+
TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
77

88
# This search allows using a build directory just inside the source
99
# directory, and saving just one copy of the test data in the source

Lib/test/test_select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def fileno(self):
4242

4343
def test():
4444
import sys
45-
if sys.platform[:3] in ('win', 'mac', 'os2'):
45+
if sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'):
4646
if verbose:
4747
print "Can't test select easily on", sys.platform
4848
return

0 commit comments

Comments
 (0)