[Jython-checkins] jython: Merged PR #28 without the test. Extended the patch to a third line and also

stefan.richthofer jython-checkins at python.org
Fri Jan 20 00:59:28 EST 2017


https://hg.python.org/jython/rev/a0be85d92cc5
changeset:   8009:a0be85d92cc5
user:        Stefan Richthofer <stefan.richthofer at gmx.de>
date:        Fri Jan 20 06:59:12 2017 +0100
summary:
  Merged PR #28 without the test. Extended the patch to a third line and also cleaned up tabs on this occasion.

files:
  src/org/python/modules/zipimport/zipimporter.java |  20 +++++-----
  1 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/src/org/python/modules/zipimport/zipimporter.java b/src/org/python/modules/zipimport/zipimporter.java
--- a/src/org/python/modules/zipimport/zipimporter.java
+++ b/src/org/python/modules/zipimport/zipimporter.java
@@ -34,7 +34,7 @@
  * Import Python modules and packages from ZIP-format archives.
  *
  * @author Philip Jenvey
- */
+ */    
 @ExposedType(name = "zipimport.zipimporter", base = PyObject.class)
 public class zipimporter extends importer<PyObject> implements Traverseproc {
 
@@ -246,7 +246,7 @@
     final PyObject zipimporter_get_filename(String fullname) {
         ModuleCodeData moduleCodeData = getModuleCode(fullname);
         if (moduleCodeData != null) {
-            return new PyString(moduleCodeData.path);
+            return Py.newStringOrUnicode(moduleCodeData.path);
         }
         return Py.None;
     }
@@ -397,7 +397,7 @@
             ZipEntry zipEntry = zipEntries.nextElement();
             String name = zipEntry.getName().replace('/', File.separatorChar);
 
-            PyObject __file__ = new PyString(archive + File.separator + name);
+            PyObject __file__ = Py.newStringOrUnicode(archive + File.separator + name);
             PyObject compress = Py.newInteger(zipEntry.getMethod());
             PyObject data_size = new PyLong(zipEntry.getCompressedSize());
             PyObject file_size = new PyLong(zipEntry.getSize());
@@ -411,7 +411,7 @@
 
             PyTuple entry = new PyTuple(__file__, compress, data_size, file_size, file_offset,
                                         time, date, crc);
-            files.__setitem__(new PyString(name), entry);
+            files.__setitem__(Py.newStringOrUnicode(name), entry);
         }
     }
 
@@ -550,12 +550,12 @@
     /* Traverseproc implementation */
     @Override
     public int traverse(Visitproc visit, Object arg) {
-    	if (files != null) {
-    		int retVal = visit.visit(files, arg);
-    		if (retVal != 0) {
-    			return retVal;
-    		}
-    	}
+        if (files != null) {
+            int retVal = visit.visit(files, arg);
+            if (retVal != 0) {
+                return retVal;
+            }
+        }
         return sys == null ? 0 : visit.visit(sys, arg);
     }
 

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list