Skip to content

Commit 26b7bea

Browse files
committed
[GR-49850] Revert hack to treat internal resources and internal files the same.
PullRequest: graalpython/3045
2 parents c83b2ef + 08f23d2 commit 26b7bea

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,6 @@ private void initializePosixSupport() {
16841684
}
16851685

16861686
private TruffleString langHome, sysPrefix, basePrefix, coreHome, capiHome, jniHome, stdLibHome;
1687-
private TruffleFile homeResourcesFile;
16881687

16891688
public void initializeHomeAndPrefixPaths(Env newEnv, String languageHome) {
16901689
if (ImageInfo.inImageBuildtimeCode()) {
@@ -1722,8 +1721,7 @@ public void initializeHomeAndPrefixPaths(Env newEnv, String languageHome) {
17221721
() -> {
17231722
try {
17241723
TruffleFile internalResource = newEnv.getInternalResource("python-home");
1725-
homeResourcesFile = internalResource == null ? null : internalResource.getAbsoluteFile();
1726-
return homeResourcesFile;
1724+
return internalResource == null ? null : internalResource.getAbsoluteFile();
17271725
} catch (IOException e) {
17281726
// fall through
17291727
}
@@ -2298,15 +2296,6 @@ void releaseGil() {
22982296
*/
22992297
@TruffleBoundary
23002298
public TruffleFile getPublicTruffleFileRelaxed(TruffleString path, TruffleString... allowedSuffixes) {
2301-
if (homeResourcesFile != null && !env.isFileIOAllowed()) {
2302-
// XXX: Workaround for Truffle resources not being considered internal truffle files
2303-
String jlPath = path.toJavaStringUncached();
2304-
String jlHome = langHome.toJavaStringUncached();
2305-
if (jlPath.startsWith(jlHome)) {
2306-
String homeRelativePath = jlPath.substring(jlHome.length() + 1);
2307-
return homeResourcesFile.resolve(homeRelativePath);
2308-
}
2309-
}
23102299
TruffleFile f = env.getInternalTruffleFile(path.toJavaStringUncached());
23112300
// 'isDirectory' does deliberately not follow symlinks because otherwise this could allow to
23122301
// escape the language home directory.

0 commit comments

Comments
 (0)