Skip to content

Commit 77728fd

Browse files
committed
Wrapped main behavior in a main() function.
1 parent 0e0f9c5 commit 77728fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

command.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def undo(self):
1818
os.rename(self.dest, self.src)
1919

2020

21-
if __name__ == "__main__":
21+
def main():
2222
command_stack = []
2323

2424
# commands are just pushed into the command stack
@@ -32,3 +32,6 @@ def undo(self):
3232
# and can also be undone at will
3333
for cmd in reversed(command_stack):
3434
cmd.undo()
35+
36+
if __name__ == "__main__":
37+
main()

0 commit comments

Comments
 (0)