lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.4.7.jcn1 for windows


From: Mats Bengtsson
Subject: Re: 1.4.7.jcn1 for windows
Date: Sun, 02 Sep 2001 19:15:10 +0200

> I  just  installed  lilypond-1.4.7.jcn1, and after compiling
> the  star  spangled  banner test file (or any other Lilypond
> file), I get the following error message :
> 
> 
> address@hidden ~$ dir
> star-spangled-banner.ly
> address@hidden ~$ LY2DVI star-spangled-banner.ly
> 
> Traceback (most recent call last):
>   File "/usr/lilypond-1.4.7.jcn1/bin/ly2dvi.py", line 69, in ?
>     import resource
> ImportError: No module named resource
> 
> 
> Is it due to my configuration, or is it a real bug?

Well, it's my fault. I fixed a problem with some Linux
versions and when I now read the fine print of the 
documentation, it appears that I used a module 'resource'
that's only available on UNIX systems. 

The patch below should hopefully solve the problem (I'm
not an Python expert so I don't know if this is the best
way to handle the problem).
A side note: why was the setrlimit statement removed 
in 1.5.8?

(The simplest way to solve the problem in your Windows
installation is simply to remove the two lines of the 
script usr/lilypond/bin/ly2dvi.py that containts the
word `resource'.)

  /Mats


diff -u scripts/ly2dvi.py~ scripts/ly2dvi.py
--- scripts/ly2dvi.py~  Thu Aug 23 15:21:55 2001
+++ scripts/ly2dvi.py   Sun Sep  2 19:09:14 2001
@@ -66,7 +66,6 @@
 import operator
 import tempfile
 import traceback
-import resource
  
  
        
@@ -81,6 +80,15 @@
        def _ (s):
                return s
 
+# Attempt to fix problems with limited stack size set by Python!
+# Sets unlimited stack size. Note that the resource module only
+# is available on UNIX.
+try:
+       import resource
+       resource.setrlimit(resource.RLIMIT_STACK, (-1,-1))
+except:
+       pass
+
 
 layout_fields = ['dedication', 'title', 'subtitle', 'subsubtitle',
          'footer', 'head', 'composer', 'arranger', 'instrument',
@@ -297,10 +305,6 @@
        Exit status of CMD
        """
 
-        # Attempt to fix problems with limited stack size set by
Python!
-        # Sets unlimited stack size.
-        resource.setrlimit(resource.RLIMIT_STACK, (-1,-1))
-
        if verbose_p:
                progress (_ ("Invoking `%s\'") % cmd)
        st = os.system (cmd)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]