Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
compare full version
  • Loading branch information
koubaa committed Aug 7, 2020
commit 0ed417ca4606f5f235cb938863bab6c96068f686
8 changes: 4 additions & 4 deletions src/runtime/pybuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static char OrderStyleToChar(BufferOrderStyle order, bool eitherOneValid
/// </summary>
public static long SizeFromFormat(string format)
{
if (Runtime.PyVersion.Minor < 9)
if (Runtime.PyVersion < new Version(3,9))
throw new NotSupportedException("SizeFromFormat requires at least Python 3.9");
return (long)Runtime.PyBuffer_SizeFromFormat(format);
}
Expand All @@ -111,7 +111,7 @@ public IntPtr GetPointer(long[] indices)
{
if (disposedValue)
throw new ObjectDisposedException(nameof(PyBuffer));
if (Runtime.PyVersion.Minor < 7)
if (Runtime.PyVersion < new Version(3, 7))
throw new NotSupportedException("GetPointer requires at least Python 3.7");
return Runtime.PyBuffer_GetPointer(ref _view, indices.Select(x => (IntPtr)x).ToArray());
}
Expand All @@ -123,7 +123,7 @@ public void FromContiguous(IntPtr buf, long len, BufferOrderStyle fort)
{
if (disposedValue)
throw new ObjectDisposedException(nameof(PyBuffer));
if (Runtime.PyVersion.Minor < 7)
if (Runtime.PyVersion < new Version(3, 7))
throw new NotSupportedException("FromContiguous requires at least Python 3.7");

if (Runtime.PyBuffer_FromContiguous(ref _view, buf, (IntPtr)len, OrderStyleToChar(fort, false)) < 0)
Expand All @@ -139,7 +139,7 @@ public void ToContiguous(IntPtr buf, BufferOrderStyle order)
{
if (disposedValue)
throw new ObjectDisposedException(nameof(PyBuffer));
if (Runtime.PyVersion.Minor < 6)
if (Runtime.PyVersion < new Version(3, 6))
throw new NotSupportedException("ToContiguous requires at least Python 3.6");

if (Runtime.PyBuffer_ToContiguous(buf, ref _view, _view.len, OrderStyleToChar(order, true)) < 0)
Expand Down