Skip to content

Commit b464b52

Browse files
authored
Potential fix to Python code
When I try to run this in VS Studio python, I get an error when using "nonlocal" and it suggests using "global" here.
1 parent 9cc44af commit b464b52

File tree

1 file changed

+1
-1
lines changed
  • articles/ai-services/speech-service/includes/how-to/recognize-speech

1 file changed

+1
-1
lines changed

articles/ai-services/speech-service/includes/how-to/recognize-speech/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Now, create a callback to stop continuous recognition when `evt` is received. Ke
118118
def stop_cb(evt):
119119
print('CLOSING on {}'.format(evt))
120120
speech_recognizer.stop_continuous_recognition()
121-
nonlocal done
121+
global done
122122
done = True
123123
```
124124

0 commit comments

Comments
 (0)