Code: Alles auswählen
** (process:25512): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:25512): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:25512): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Stderr/Stdout kurzzeitig umzuleiten geht nicht:
Code: Alles auswählen
>>> import sys
>>> from io import BytesIO
>>> sys.stderr = BytesIO()
>>> sys.stdout = BytesIO()
>>> print 's'
>>> import pynotify
** (process:25512): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:25512): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:25512): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Code: Alles auswählen
with warnings.catch_warnings():
warnings.simplefilter('error')
import pynotify
Auch auf StackOverflow