Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit cdc22b2

Browse files
committed
fixes to make tests pass on windows
1 parent c52448f commit cdc22b2

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

exceptions.go

-6
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,6 @@ func PyErr_SetInterrupt() {
246246
C.PyErr_SetInterrupt()
247247
}
248248

249-
// int PySignal_SetWakeupFd(int fd)
250-
// This utility function specifies a file descriptor to which a '\0' byte will be written whenever a signal is received. It returns the previous such file descriptor. The value -1 disables the feature; this is the initial state. This is equivalent to signal.set_wakeup_fd() in Python, but without any error checking. fd should be a valid file descriptor. The function should only be called from the main thread.
251-
func PySignal_SetWakeupFd(fd int) int {
252-
return int(C.PySignal_SetWakeupFd(C.int(fd)))
253-
}
254-
255249
// PyObject* PyErr_NewException(char *name, PyObject *base, PyObject *dict)
256250
// Return value: New reference.
257251
// This utility function creates and returns a new exception object. The name argument must be the name of the new exception, a C string of the form module.class. The base and dict arguments are normally NULL. This creates a class object derived from Exception (accessible in C as PyExc_Exception).

exceptions_posix.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// +build !windows
2+
3+
package python
4+
5+
// int PySignal_SetWakeupFd(int fd)
6+
// This utility function specifies a file descriptor to which a '\0' byte will be written whenever a signal is received. It returns the previous such file descriptor. The value -1 disables the feature; this is the initial state. This is equivalent to signal.set_wakeup_fd() in Python, but without any error checking. fd should be a valid file descriptor. The function should only be called from the main thread.
7+
func PySignal_SetWakeupFd(fd int) int {
8+
return int(C.PySignal_SetWakeupFd(C.int(fd)))
9+
}

object_posix.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
package python
24

35
//#include <stdlib.h>

object_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func file2py(f *os.File, mode string) *C.FILE {
1616
cmode := C.CString(mode)
1717
defer C.free(unsafe.Pointer(cmode))
18-
name := C.CString(file.Name())
18+
name := C.CString(f.Name())
1919
defer C.free(unsafe.Pointer(name))
2020
file := C.fopen(name, cmode)
2121
return file

0 commit comments

Comments
 (0)