install.py

branch
6_1_x
changeset 5052
6803b3fcc4c9
parent 4912
d20551adffb1
child 5058
41df96c4c8ce
equal deleted inserted replaced
5043:a4044e648b75 5052:6803b3fcc4c9
467 if not os.path.exists(os.path.join(dirName, formName)): 467 if not os.path.exists(os.path.join(dirName, formName)):
468 os.remove(os.path.join(dirName, sourceName)) 468 os.remove(os.path.join(dirName, sourceName))
469 if os.path.exists(os.path.join(dirName, sourceName + "c")): 469 if os.path.exists(os.path.join(dirName, sourceName + "c")):
470 os.remove(os.path.join(dirName, sourceName + "c")) 470 os.remove(os.path.join(dirName, sourceName + "c"))
471 471
472 # step 2: delete the __pycache__ directory and all *.pyc files 472 # step 2: delete the __pycache__ directory and all remaining *.pyc files
473 if os.path.exists(os.path.join(dirName, "__pycache__")): 473 if os.path.exists(os.path.join(dirName, "__pycache__")):
474 shutil.rmtree(os.path.join(dirName, "__pycache__")) 474 shutil.rmtree(os.path.join(dirName, "__pycache__"))
475 for name in [f for f in dirListing if fnmatch.fnmatch(f, "*.pyc")]: 475 for name in [f for f in os.listdir(dirName)
476 if fnmatch.fnmatch(f, "*.pyc")]:
476 os.remove(os.path.join(dirName, name)) 477 os.remove(os.path.join(dirName, name))
477 478
478 # step 3: descent into subdirectories and delete them if empty 479 # step 3: descent into subdirectories and delete them if empty
479 for name in os.listdir(dirName): 480 for name in os.listdir(dirName):
480 name = os.path.join(dirName, name) 481 name = os.path.join(dirName, name)

eric ide

mercurial