[Bugs] #1317 UNSP: check for Rainbow binaries before trying to use them

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Oct 1 13:40:37 EDT 2009


#1317: check for Rainbow binaries before trying to use them
------------------------------------------+---------------------------------
    Reporter:  sascha_silbe               |          Owner:  sascha_silbe     
        Type:  defect                     |         Status:  accepted         
    Priority:  Unspecified by Maintainer  |      Milestone:  0.86             
   Component:  sugar-toolkit              |        Version:  Git as of bugdate
    Severity:  Unspecified                |       Keywords:  r!               
Distribution:  Unspecified                |   Status_field:  Assigned         
------------------------------------------+---------------------------------
Changes (by tomeu):

  * keywords:  r? => r!


Comment:

 {{{
         247             dev_null = file('/dev/null', 'w')
 }}}

 Won't be leaking descriptors like this?

 {{{
         249             rainbow_enabled = subprocess.call(['which',
 'rainbow-run'],
         250                 stdout=dev_null, stderr=dev_null) == 0 and \
         251                 os.path.exists('/etc/olpc-security')
 }}}

 I think that it's better to try to have one statement per line, rather
 than cramming several stuff in just one statement. Intermediate variables
 are a chance to communicate what your code is doing without having to use
 comments or letting the reader guess it.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/1317#comment:8>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list