Skip to content

Commit 2cc8347

Browse files
committed
Clean up
1 parent 812a99c commit 2cc8347

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/LZMAModuleBuiltins.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,6 @@ private static LZMAOutputStream createLZMAOutputStream(ByteArrayOutputStream bos
409409
@TypeSystemReference(PythonArithmeticTypes.class)
410410
abstract static class LZMADecompressorNode extends LZMANode {
411411

412-
@Child private GetItemNode getItemNode;
413-
414-
@Child private IsBuiltinClassProfile keyErrorProfile;
415-
416412
@Specialization
417413
PLZMADecompressor doCreate(VirtualFrame frame, Object cls, Object formatObj, Object memlimitObj, Object filters,
418414
@CachedLibrary(limit = "2") PythonObjectLibrary lib) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/zipimporter/PZipImporter.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.oracle.graal.python.builtins.objects.dict.PDict;
3838
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
3939
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
40-
import com.oracle.truffle.api.CompilerDirectives;
4140
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
4241
import com.oracle.truffle.api.object.Shape;
4342

@@ -214,8 +213,8 @@ protected String makePackagePath(String fullname) {
214213
* @return code
215214
* @throws IOException
216215
*/
217-
@CompilerDirectives.TruffleBoundary
218-
private String getCode(String filenameAndSuffix) throws IOException {
216+
@TruffleBoundary
217+
public static String getCodeFromArchive(String filenameAndSuffix, String archive) throws IOException {
219218
ZipFile zip = null;
220219
try {
221220
zip = new ZipFile(archive);
@@ -237,7 +236,7 @@ private String getCode(String filenameAndSuffix) throws IOException {
237236
reader.close();
238237
return code.toString();
239238
} catch (IOException e) {
240-
throw new IOException("Can not read code from " + makePackagePath(filenameAndSuffix), e);
239+
throw e;
241240
} finally {
242241
if (zip != null) {
243242
try {
@@ -323,8 +322,12 @@ protected final ModuleCodeData getModuleCode(String fullname) throws IOException
323322

324323
boolean isPackage = entry.type.contains(EntryType.IS_PACKAGE);
325324

326-
String code = "";
327-
code = getCode(searchPath);
325+
String code;
326+
try {
327+
code = getCodeFromArchive(searchPath, archive);
328+
} catch (IOException e) {
329+
throw new IOException("Can not read code from " + makePackagePath(searchPath), e);
330+
}
328331
return new ModuleCodeData(code, isPackage, fullSearchPath);
329332
}
330333
return null;

0 commit comments

Comments
 (0)