mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	test: fix launch_efi()
We cannot use old_dtb in the finally block if it has not been assigned
before the try block.
test/py/tests/test_efi_fit.py:458:30:
E0601: Using variable 'old_dtb' before assignment (used-before-assignment)
Fixes: 8391f95549 ("test/py: Create a test for launching UEFI binaries from FIT images")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
			
			
This commit is contained in:
		| @@ -433,11 +433,13 @@ def test_efi_fit_launch(u_boot_console): | |||||||
|     sys_arch = cons.config.buildconfig.get('config_sys_arch', '"sandbox"')[1:-1] |     sys_arch = cons.config.buildconfig.get('config_sys_arch', '"sandbox"')[1:-1] | ||||||
|     is_sandbox = sys_arch == 'sandbox' |     is_sandbox = sys_arch == 'sandbox' | ||||||
|  |  | ||||||
|  |     if is_sandbox: | ||||||
|  |         old_dtb = cons.config.dtb | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         if is_sandbox: |         if is_sandbox: | ||||||
|             # Use our own device tree file, will be restored afterwards. |             # Use our own device tree file, will be restored afterwards. | ||||||
|             control_dtb = make_dtb('internal', False) |             control_dtb = make_dtb('internal', False) | ||||||
|             old_dtb = cons.config.dtb |  | ||||||
|             cons.config.dtb = control_dtb |             cons.config.dtb = control_dtb | ||||||
|  |  | ||||||
|         # Run tests |         # Run tests | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user