0

I am trying to make my updater able to reboot so I can update without stopping the program, here is my code, and it doesn't work, anyone know how to make it work?

import versionLoader
import os

cwd = os.getcwd()
cwdKeep = cwd

def reboot():
    os.chdir(cwdKeep)
    versionLoader.exit()
    import versionLoader

I get this error:

AttributeError: partially initialized module 'versionLoader' has no attribute 'exit' (most likely due to a circular import)

1 Answers1

1

Hello you can reload a already imported package by using the reload function in the importlib package docs here

Logtism
  • 125
  • 1
  • 6