Running Python 3.7 Runtimeerror: generator raised stopiteration exception occurred during test

When I first started learning Python, I found an exception when I ran the home page test code.
The code is as follows:

import web
urls = (
    '/(.*)', 'hello'
app = web.application(urls, globals())

class hello:        
    def GET(self, name):
        if not name: 
            name = 'World'
        return 'Hello, ' + name + '!'

if __name__ == "__main__":

The exceptions are as follows:

Traceback (most recent call last):
  File "C:\Users\HHHHH\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\", line 526, in take
    yield next(seq)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\workspace\HelloPython\", line 7, in <module>
    app = web.application(urls, globals())
  File "C:\Users\HHHHH\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\", line 62, in __init__
  File "C:\Users\HHHHH\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\", line 130, in init_mapping
    self.mapping = list(, 2))
  File "C:\Users\HHHHH\AppData\Local\Programs\Python\Python37-32\lib\site-packages\web\", line 531, in group
    x = list(take(seq, size))
RuntimeError: generator raised StopIteration

Follow the exception prompt to find the appropriate code (… “, line 531, in group), as follows:

Here, call line 524 take method and modify it as follows according to the information on the official website (note the indentation) :

Restart successfully after modification:


Read More: