Skip to content

Commit 3b32695

Browse files
committed
Fix failing tests
1 parent 9266db0 commit 3b32695

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Src/IronPython/Modules/_io.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void _checkClosed() {
9999
_checkClosed(null);
100100
}
101101

102-
public void _checkClosed(string? msg) {
102+
internal void _checkClosed(string? msg) {
103103
if (closed) {
104104
throw PythonOps.ValueError(msg ?? "I/O operation on closed file.");
105105
}
@@ -109,7 +109,7 @@ public void _checkReadable() {
109109
_checkReadable(null);
110110
}
111111

112-
public void _checkReadable(string? msg) {
112+
internal void _checkReadable(string? msg) {
113113
if (!readable(context)) {
114114
throw UnsupportedOperationWithMessage(context, msg ?? "File or stream is not readable.");
115115
}
@@ -119,17 +119,17 @@ public void _checkSeekable() {
119119
_checkSeekable(null);
120120
}
121121

122-
public void _checkSeekable(string? msg) {
122+
internal void _checkSeekable(string? msg) {
123123
if (!seekable(context)) {
124-
throw PythonOps.ValueError(msg ?? "File or stream is not seekable.");
124+
throw UnsupportedOperationWithMessage(context, msg ?? "File or stream is not seekable.");
125125
}
126126
}
127127

128128
public void _checkWritable() {
129129
_checkWritable(null);
130130
}
131131

132-
public void _checkWritable(string? msg) {
132+
internal void _checkWritable(string? msg) {
133133
if (!writable(context)) {
134134
throw UnsupportedOperationWithMessage(context, msg ?? "File or stream is not writable.");
135135
}
@@ -998,6 +998,8 @@ public override BigInteger seek(CodeContext/*!*/ context, BigInteger pos, [Optio
998998
throw PythonOps.ValueError("invalid whence ({0}, should be 0, 1, or 2)", whenceInt);
999999
}
10001000

1001+
_checkSeekable();
1002+
10011003
lock (this) {
10021004
// fast-path to seek within the buffer
10031005
if (_readBuf.Count > 0 && _absPos != -1) {

0 commit comments

Comments
 (0)