File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,16 @@ def write_const(cleanup_files):
4545 )
4646
4747
48+ def get_objects_path ():
49+ return Path .cwd () / "src/pkgcheck/_objects.py"
50+
51+
52+ def wipe_objects_on_disk ():
53+ get_objects_path ().unlink (missing_ok = True )
54+
55+
4856def write_objects (cleanup_files ):
49- cleanup_files .append (path := Path . cwd () / "src/pkgcheck/_objects.py" )
57+ cleanup_files .append (path := get_objects_path () )
5058 print (f"writing objects to { path } " )
5159
5260 with sys_path ():
@@ -96,6 +104,9 @@ def write_files(cleanup_files):
96104
97105@contextmanager
98106def create_generated_files ():
107+ # the objects registry isn't hot reloadable, and it's fragile for wiping
108+ # it if it already loaded the _objects_file. Thus just shoot it first thing.
109+ wipe_objects_on_disk ()
99110 cleanup_files = []
100111 try :
101112 write_verinfo (cleanup_files )
You can’t perform that action at this time.
0 commit comments