Skip to content

Commit

Permalink
Re-add Python 2 compatibility code HTCONDOR-549
Browse files Browse the repository at this point in the history
When the blahp is installed as a user from a tarball, we can't guarantee
that Python 3 is installed on the system. So restore the Python 2
compatibility code for systems where Python 3 isn't available in the
base OS install.
  • Loading branch information
JaimeFrey committed Jul 26, 2021
1 parent bef1de5 commit 78c768d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scripts/blah.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""Common functions for BLAH python scripts"""

from configparser import RawConfigParser
from io import StringIO
try: # for Python 2
from ConfigParser import RawConfigParser
from StringIO import StringIO
except ImportError: # for Python 3
from configparser import RawConfigParser
from io import StringIO

class BlahConfigParser(RawConfigParser, object):

Expand Down
2 changes: 2 additions & 0 deletions src/scripts/lsf_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/pbs_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/slurm_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
will reuse this for subsequent queries.
"""

from __future__ import print_function

import os
import re
import pwd
Expand Down

0 comments on commit 78c768d

Please sign in to comment.