Fix UnboundLocalError for 'time' variable in WiFi scanning

- Removed local import of 'time' module in scan_wifi_networks method
- The 'time' module is already imported at the top of the file
- Local import was creating a variable that shadowed the imported module
- This caused UnboundLocalError when trying to access time.sleep(2)
- WiFi scanning should now work without variable scoping errors

This resolves the 'cannot access local variable time where is not associated with a value' error
that occurred during WiFi network scanning in the AutoInstaller GUI.
parent 7ee823b1
...@@ -348,7 +348,6 @@ class NetworkInterfaceDialog(QDialog): ...@@ -348,7 +348,6 @@ class NetworkInterfaceDialog(QDialog):
# Enable interface for scanning # Enable interface for scanning
subprocess.run(['ip', 'link', 'set', self.selected_interface, 'up'], check=True) subprocess.run(['ip', 'link', 'set', self.selected_interface, 'up'], check=True)
# Wait a moment # Wait a moment
import time
time.sleep(2) time.sleep(2)
# Scan # Scan
result = subprocess.run(['iw', 'dev', self.selected_interface, 'scan'], result = subprocess.run(['iw', 'dev', self.selected_interface, 'scan'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment