diff --git a/Control/AthenaCommon/python/ChapPy.py b/Control/AthenaCommon/python/ChapPy.py index f2671c8494338e8e687f8c6d1af682efb9baac53..2bc329b2522dc78691bc8254b3c591bb04d7e1cd 100755 --- a/Control/AthenaCommon/python/ChapPy.py +++ b/Control/AthenaCommon/python/ChapPy.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # @file : ChapPy.py # @author: Sebastien Binet <binet@cern.ch> @@ -32,9 +32,10 @@ def dump( buf, stdout = sys.stdout ): fname = None if isinstance(buf, str): fname = buf + from builtins import file if six.PY3: import io - file = io.IOBase + file = io.IOBase # noqa: F811 if isinstance(buf, file): fname = buf.name with open(fname, 'r') as fd: diff --git a/Control/AthenaCommon/python/JobProperties.py b/Control/AthenaCommon/python/JobProperties.py index 4a6805b9e973e5660297652accd66d71568eff03..fa0096d6f6bcd584f68bb3c6c55d2645196cbcb2 100755 --- a/Control/AthenaCommon/python/JobProperties.py +++ b/Control/AthenaCommon/python/JobProperties.py @@ -733,7 +733,7 @@ class JobPropertyContainer (object): """ tp=type(data) if tp.__name__=='dict': - list_context=JobProperty._nInstancesContextDict.keys() + list_context=list(JobProperty._nInstancesContextDict.keys()) for i in data.keys(): for j in data[i].keys(): if list_context.count(i+'.'+j)==1: diff --git a/Control/AthenaCommon/share/athena.py b/Control/AthenaCommon/share/athena.py index e1d808e48853080fa924b66da960c6e3b5bee96f..1cc99b8102a5f5f78df4a64fff8b78c52062fb44 100755 --- a/Control/AthenaCommon/share/athena.py +++ b/Control/AthenaCommon/share/athena.py @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # athena.py is born as shell script to preload some optional libraries # @@ -149,7 +149,7 @@ fhistory = os.path.expanduser( '~/.athena.history' ) ## interface setup as appropriate if opts.run_batch and not opts.dbg_stage: # in batch there is no need for stdin - if os.isatty( sys.stdin.fileno() ): + if sys.stdin and os.isatty( sys.stdin.fileno() ): os.close( sys.stdin.fileno() ) else: # Make sure ROOT gets initialized early, so that it shuts down last. diff --git a/Control/AthenaCommon/share/athena3.py b/Control/AthenaCommon/share/athena3.py index 4bffdc3e87d7ce30321fb1df43ed4b79ea66b152..c563db0e1ce48c3e9bb6170e78b21d0dcc213758 100755 --- a/Control/AthenaCommon/share/athena3.py +++ b/Control/AthenaCommon/share/athena3.py @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # athena.py is born as shell script to preload some optional libraries # @@ -149,7 +149,7 @@ fhistory = os.path.expanduser( '~/.athena.history' ) ## interface setup as appropriate if opts.run_batch and not opts.dbg_stage: # in batch there is no need for stdin - if os.isatty( sys.stdin.fileno() ): + if sys.stdin and os.isatty( sys.stdin.fileno() ): os.close( sys.stdin.fileno() ) else: # Make sure ROOT gets initialized early, so that it shuts down last.