TypeError:构造函数返回NULL

时间:2018-07-03 18:34:50

标签: python windows gtk gtk3 msys2

from gi.repository import GLib , GObject
from multiprocessing import Pipe
parent,child = Pipe(duplex=False)

一些代码。...

parent,child = Pipe(duplex=False)

一些代码...

GObject.io_add_watch(parent.fileno() , GObject.IO_IN , myfonction )

然后我收到此错误:

Traceback (most recent call last):
File "C:\msys64\mingw64\lib\python3.5\threading.py", line 914, in `_bootstrap_inner`
self.run()
File "C:\msys64\mingw64\lib\python3.5\threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "mnG.py", line 1091, in
test = Thread(target=(lambda : GObject.io_add_watch(parant.fileno(),  GObject.IO_IN, self.up)),name="GObject")
File "C:\msys64\mingw64\lib\python3.5\site-packages\gi\overrides\GLib.py", line 749, in io_add_watch
channel, priority, condition, func, user_data = _io_add_watch_get_args(*args, **kwargs)
File "C:\msys64\mingw64\lib\python3.5\site-packages\gi\overrides\GLib.py",  line 729, in _io_add_watch_get_args
real_channel = GLib.IOChannel.unix_new(channel)
TypeError: constructor returned NULL

但是此小代码在Linux(debian)上正常工作。 为什么?如何从父级获得有效的文件描述符?

0 个答案:

没有答案