114
115def main():
116 """Main loop processing sites."""
117 global families_excepts118 q = Queue()
119 threads = spawn_threads(q)
120 for fam_name in families_list:
82
83def threads_target(q):
84 """Thread processing a single site."""
85 global families_excepts 86 while True:
87 try:
88 fam, code = q.get()
The variable is defined through the global
statement but no assignment to this variable is done. It is recommended to remove it if not necessary.
def my_func():
global a
return a
If it is a newly defined global, make sure to assign a value to it.
def my_func():
global a
a = 1 # Assign to the newly defined global value.
return a
Or if the global should be already defined, you can remove the global
statement.
a = 1
def my_func():
return a # The global statement can be removed
Note: DeepSource will remove the global
statement during autofix.