[ET Trac] [Einstein Toolkit] #2058: Simfactory assumes python is python2

Einstein Toolkit trac-noreply at einsteintoolkit.org
Fri Aug 4 13:30:30 CDT 2017


#2058: Simfactory assumes python is python2
-------------------------+--------------------------------------------------
  Reporter:  sbrandt     |       Owner:                     
      Type:  defect      |      Status:  new                
  Priority:  unset       |   Milestone:                     
 Component:  SimFactory  |     Version:  development version
Resolution:              |    Keywords:  newuser            
-------------------------+--------------------------------------------------

Comment (by sbrandt):

 Based on conversations and emails, I think this is what we want.

 {{{
 diff --git a/bin/sim b/bin/sim
 index 92f74ab..c6bc075 100755
 --- a/bin/sim
 +++ b/bin/sim
 @@ -20,4 +20,18 @@ if [ -z "$cmd" ]; then
  fi

  # Forward the call
 -exec python "$cmd" "$@"
 +for PYEXE in python python2
 +do
 +    $PYEXE - > /dev/null 2>&1 << EOF
 +import sys
 +if sys.hexversion < 0x3000000:
 +    exit(0)
 +else:
 +    exit(1)
 +EOF
 +    if [ $? = 0 ]
 +    then
 +        exec $PYEXE "$cmd" "$@"
 +        break
 +    fi
 +done
 }}}

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/2058#comment:2>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list