mirror of
https://github.com/Derisis13/barusu.git
synced 2025-12-06 19:42:48 +01:00
fix: typo in makedirs
fix: replace distutils.spawn.find_executalbe with shutil.which
This commit is contained in:
6
main.py
Normal file → Executable file
6
main.py
Normal file → Executable file
@@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import distutils.spawn
|
import shutil
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -99,7 +99,7 @@ def restore():
|
|||||||
def check_progs(prog):
|
def check_progs(prog):
|
||||||
if prog is False:
|
if prog is False:
|
||||||
return False
|
return False
|
||||||
if distutils.spawn.find_executable(prog) is False:
|
if shutil.which(prog) is False:
|
||||||
print("Missing program:" + prog + "! It is removed from the list of actions to perform...")
|
print("Missing program:" + prog + "! It is removed from the list of actions to perform...")
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -155,7 +155,7 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
os.chdir(backupdir)
|
os.chdir(backupdir)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
os.mkdirs(backupdir, mode=0o774)
|
os.makedirs(backupdir, mode=0o774)
|
||||||
os.chdir(backupdir)
|
os.chdir(backupdir)
|
||||||
if restore_mode:
|
if restore_mode:
|
||||||
restore()
|
restore()
|
||||||
|
|||||||
Reference in New Issue
Block a user