Skip to content

sixdb is python3-only, but tests for 2.6 #37

@jmuf

Description

@jmuf

The formatted print(..%..) statements in sixdb are python3-only, but the script is being invoked with #! /usr/bin/env python (i.e defaults to python2), and contains an explicit version check for "2.6 or above".
With python2, this gives

SyntaxError: invalid syntax
  File "/afs/cern.ch/project/sixtrack/SixDesk_utilities/pro/utilities/externals/SixDeskDB/sixdb", line 88
    print("%s:"%cmd, end=' ')

Either the formatted print() should be redone:

$ grep -n 'print(.*%' sixdb
53:                print("Error: command `%s' not found"%cmd)
60:                print("Error in `%s' command."%cmd)
84:                print("%-11s: %s"%(cmd,doc))
88:            print("%s:"%cmd, end=' ')
355:           print(('Error in da_vs_turns: database %s not found!'%dbname))
372:        print("db=SixDeskDB('%s')\n"%study)
432:        print("Wrong plot option: %s"%name)

, or the script should declare itself to be for python3-only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions