Skip to content

Commit c71cec6

Browse files
committed
remove missed bit of legacy path hacking
1 parent e9362f7 commit c71cec6

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

GSASII/GSASIIpath.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,24 +1781,6 @@ def makeScriptShortcut():
17811781
return
17821782
return newfil
17831783

1784-
# see if a directory for local modifications is defined. If so, stick that in the path
1785-
if os.path.exists(os.path.expanduser('~/.G2local/')):
1786-
sys.path.insert(0,os.path.expanduser('~/.G2local/'))
1787-
fl = glob.glob(os.path.expanduser('~/.G2local/GSASII*.py*'))
1788-
files = ""
1789-
prev = None
1790-
for f in sorted(fl): # make a list of files, dropping .pyc files where a .py exists
1791-
f = os.path.split(f)[1]
1792-
if os.path.splitext(f)[0] == prev: continue
1793-
prev = os.path.splitext(f)[0]
1794-
if files: files += ", "
1795-
files += f
1796-
if files:
1797-
print("*"*75)
1798-
print("Warning: the following source files are locally overridden in "+os.path.expanduser('~/.G2local/'))
1799-
print(" "+files)
1800-
print("*"*75)
1801-
18021784
BinaryPathFailed = False
18031785
BinaryPathLoaded = False
18041786
binaryPath = ''

GSASII/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ def no_path_hacking(event_name, args):
1515
return
1616
module, filename, path, meta_path, path_hooks = args
1717
if path is not None and tuple(path) != init_path:
18-
lines = list(traceback.format_stack())
19-
for line in lines:
20-
print(line.strip())
21-
print(set(path) - set(init_path))
18+
print('Oops, path was hacked with...',set(path) - set(init_path))
19+
raise PathHackingException()
20+
#lines = list(traceback.format_stack()) # raises recursive exception in "pixi run ui"
21+
#for line in lines:
22+
# print(line.strip())
2223
#sys.exit(1)
23-
raise PathHackingException(lines[-2].strip())
24+
#raise PathHackingException(lines[-2].strip())
2425
return no_path_hacking
2526

2627
if os.environ.get("GSASII_NOPATHHACKING", ''):

0 commit comments

Comments
 (0)