Skip to content

Commit 8314d1c

Browse files
committed
Update to fstrings
1 parent 3df36b8 commit 8314d1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_shell.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def bail(self, message=None):
125125
if message is None:
126126
self.error("Exiting due to error")
127127
else:
128-
self.error("Exiting due to error: {}".format(message))
128+
self.error(f"Exiting due to error: {message}")
129129
sys.exit(1)
130130

131131
def error(self, message):
@@ -258,7 +258,7 @@ def grep(self, search_term, location):
258258
"""
259259
location = self.path(location)
260260
return self.run_command(
261-
"grep {} {}".format(search_term, location), suppress_message=True
261+
f"grep {search_term} {location}", suppress_message=True
262262
)
263263

264264
@staticmethod
@@ -385,7 +385,7 @@ def require_root(self):
385385
"""
386386
if not self.is_root():
387387
print("Installer must be run as root.")
388-
print("Try 'sudo python3 {}'".format(self.script()))
388+
print(f"Try 'sudo python3 {self.script()}'")
389389
sys.exit(1)
390390

391391
def write_text_file(self, path, content, append=True):
@@ -516,7 +516,7 @@ def prompt_reboot(self):
516516

517517
def check_kernel_update_reboot_required(self):
518518
"""Checks if the pi needs to be rebooted since the last kernel update"""
519-
if not self.exists("/lib/modules/{}".format(self.release())):
519+
if not self.exists(f"/lib/modules/{self.release()}"):
520520
self.error(
521521
"OS has not been rebooted since last kernel update. "
522522
"Please reboot and re-run the script."

0 commit comments

Comments
 (0)