Skip to content

Commit

Permalink
Merge pull request #53 from amecca/py2compatibility
Browse files Browse the repository at this point in the history
Restore python2 compatibility of the code.
  • Loading branch information
oglez authored Nov 28, 2024
2 parents e86e101 + 072ee1a commit a428937
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cmsstyle/cmsstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def SetLumi(lumi, unit="fb", round_lumi=False):
"""
global cms_lumi
if lumi != "":
cms_lumi = f"{lumi:.0f}" if round_lumi else f"{lumi}"
cms_lumi += f" {unit}^{{#minus1}}"
cms_lumi = "{:.0f}".format(lumi) if round_lumi else "{}".format(lumi)
cms_lumi += " {unit}^{{#minus1}}".format(unit=unit)
else:
cms_lumi = lumi

Expand Down Expand Up @@ -1000,7 +1000,7 @@ def cmsObjectDraw (obj,opt='',**kwargs):
elif hasattr(obj,xkey):
method = xkey
else:
raise AttributeError(f"Indicated argument for configuration is invalid: {xkey} {xval} {type(obj)}")
raise AttributeError("Indicated argument for configuration is invalid: {} {} {}".format(xkey, xval, type(obj)))

if xval is None:
getattr(obj,method)()
Expand Down

0 comments on commit a428937

Please sign in to comment.