From: <otm...@us...> - 2006-06-13 03:52:38
|
Revision: 2818 Author: otmarhumbel Date: 2006-06-12 20:52:33 -0700 (Mon, 12 Jun 2006) ViewCVS: http://svn.sourceforge.net/jython/?rev=2818&view=rev Log Message: ----------- print a better warning if user.home/.jython is a directory instead of a file Modified Paths: -------------- trunk/jython/src/org/python/core/PySystemState.java Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2006-06-12 19:32:18 UTC (rev 2817) +++ trunk/jython/src/org/python/core/PySystemState.java 2006-06-13 03:52:33 UTC (rev 2818) @@ -332,7 +332,6 @@ ".jython"); addRegistryFile(homeFile); } catch (Exception exc) { - ; } } if (postProperties != null) { @@ -349,17 +348,20 @@ private static void addRegistryFile(File file) { if (file.exists()) { - registry = new Properties(registry); - try { - FileInputStream fp = new FileInputStream(file); + if (!file.isDirectory()) { + registry = new Properties(registry); try { - registry.load(fp); - } finally { - fp.close(); + FileInputStream fp = new FileInputStream(file); + try { + registry.load(fp); + } finally { + fp.close(); + } + } catch (IOException e) { + System.err.println("couldn't open registry file: " + file.toString()); } - } catch (IOException e) { - System.err.println("couldn't open registry file: " + - file.toString()); + } else { + System.err.println("warning: " + file.toString() + " is a directory, not a file"); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |