Fix failing test

This commit is contained in:
Kovid Goyal 2018-12-11 10:08:52 +05:30
parent d20c65ef80
commit f6b5e54890
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 2 deletions

View File

@ -962,4 +962,7 @@ class Boss:
def safe_delete_temp_file(self, path): def safe_delete_temp_file(self, path):
if is_path_in_temp_dir(path): if is_path_in_temp_dir(path):
os.remove(path) try:
os.remove(path)
except FileNotFoundError:
pass

View File

@ -368,7 +368,10 @@ handle_add_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_
if (fd == -1) ABRT(EBADF, "Failed to open file %s for graphics transmission with error: [%d] %s", fname, errno, strerror(errno)); if (fd == -1) ABRT(EBADF, "Failed to open file %s for graphics transmission with error: [%d] %s", fname, errno, strerror(errno));
img->data_loaded = mmap_img_file(self, img, fd, g->data_sz, g->data_offset); img->data_loaded = mmap_img_file(self, img, fd, g->data_sz, g->data_offset);
close(fd); close(fd);
if (tt == 't') { call_boss(safe_delete_temp_file, "s", fname); } if (tt == 't') {
if (global_state.boss) { call_boss(safe_delete_temp_file, "s", fname); }
else unlink(fname);
}
else if (tt == 's') shm_unlink(fname); else if (tt == 's') shm_unlink(fname);
break; break;
default: default: