为什么在传奇中使用两次时“ yield”会引发错误?

时间:2019-03-25 15:13:23

标签: javascript reactjs redux-saga

我正在重新了解sagas,我想知道为什么我在import can import binascii import time import logging from PyQt5.QtCore import QThread import matplotlib.pyplot as plt class Bus_CAN(QThread): def __init__(self,Logger,ID,channel,CW_Mode,Key_ID): QThread.__init__(self) self.Channel = channel self.Result = [] try : self.bus = can.interface.Bus( bustype='vector', channel = self.Channel) self.Connected = True print('CAN Connection OK !') except : self.Connected = False print('CAN Connection error !') 底部遇到此错误。我是否需要将这两行包装在另一个生成器函数中,然后调用它来减轻错误并进行构建?

yield

1 个答案:

答案 0 :(得分:1)

您在setTimeout中的回调函数不是生成器函数。 因此,您不能在其中使用yield。

# rewrite all http requests to SSL
server {
  listen 80;
  listen [::]:80;
  server_name $hostname;
  return 301 $https://www.$host$request_uri;
}
# handle all request with SSL
server {
  listen 443 ssl;
  listen [::]:443 ssl;

  # where do i get SSL docs from in a proxied environment?
  ssl_certificate     /var/www/html/web/domain.crt;
  ssl_certificate_key /var/www/html/web/domain.key;

  server_name www.$hostname;
  root /var/www/html/web;
  index index.php;
}

应该能够帮助您