本文整理汇总了Python中builtins.PermissionError方法的典型用法代码示例。如果您正苦于以下问题:Python builtins.PermissionError方法的具体用法?Python builtins.PermissionError怎么用?Python builtins.PermissionError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类builtins
的用法示例。
在下文中一共展示了builtins.PermissionError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addWriter
# 需要导入模块: import builtins [as 别名]
# 或者: from builtins import PermissionError [as 别名]
def addWriter(self, writer):
if writer in self._writers.keys() or \
writer in self._continuousPolling._writers:
return
fd = writer.fileno()
try:
self._asyncioEventloop.add_writer(fd, callWithLogger, writer,
self._readOrWrite, writer,
False)
self._writers[writer] = fd
except PermissionError:
self._unregisterFDInAsyncio(fd)
# epoll(7) doesn't support certain file descriptors,
# e.g. filesystem files, so for those we just poll
# continuously:
self._continuousPolling.addWriter(writer)
except BrokenPipeError:
# The kqueuereactor will raise this if there is a broken pipe
self._unregisterFDInAsyncio(fd)
except:
self._unregisterFDInAsyncio(fd)
raise