Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/IronPython.Modules/nt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public static object fstat(CodeContext/*!*/ context, int fd) {
}
if (streams.IsConsoleStream()) return new stat_result(0x2000);
if (streams.IsStandardIOStream()) return new stat_result(0x1000);
if (StatStream(streams.ReadStream) is not null and var res) return res;
if (StatStream(streams.ReadStream) is object res) return res;
}
return LightExceptions.Throw(PythonOps.OSError(PythonErrno.EBADF, "Bad file descriptor"));

Expand Down
6 changes: 3 additions & 3 deletions src/core/IronPython.Modules/termios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public static object tcgetwinsize(CodeContext context, int fd) {

object result = PythonFcntl.ioctl(fd, TIOCGWINSZ, buf, mutate_flag: true);

if (ToTermiosError(context, result) is not null and var ex) {
if (ToTermiosError(context, result) is object ex) {
return ex;
}
return PythonTuple.MakeTuple((int)ws[0], (int)ws[1]);
Expand All @@ -431,7 +431,7 @@ public static object tcgetwinsize(CodeContext context, int fd) {
var buf = new MemoryBufferProtocolWrapper<ushort>(ws.AsMemory());

object result = PythonFcntl.ioctl(fd, TIOCGWINSZ, buf, mutate_flag: true);
if (ToTermiosError(context, result) is not null and var ex) {
if (ToTermiosError(context, result) is object ex) {
return ex;
}

Expand All @@ -442,7 +442,7 @@ public static object tcgetwinsize(CodeContext context, int fd) {
}

result = PythonFcntl.ioctl(fd, TIOCSWINSZ, buf);
if (ToTermiosError(context, result) is not null and var ex2) {
if (ToTermiosError(context, result) is object ex2) {
return ex2;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/IronPython.Tests/Cases/CaseExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private int GetResult(TestInfo testcase, ScriptEngine engine, ScriptSource sourc
#pragma warning disable SYSLIB0006 // 'Thread.ResetAbort is not supported and throws PlatformNotSupportedException.'
Thread.ResetAbort();
#pragma warning restore SYSLIB0006
} catch (Exception ex) when (ex.GetPythonException() is not null and var pex) {
} catch (Exception ex) when (ex.GetPythonException() is object pex) {
if (DynamicHelpers.GetPythonType(pex).Name == "SkipTest") {
NUnit.Framework.TestContext.Progress.WriteLine($"Test {testcase.Name} skipped: {pex}");
res = 0;
Expand Down