sandbox/sandbox: fix saving file changes
PATCH 1/1 sandbox/sandbox: fix saving file changes
Fixes the following backtrace on saving files:
$ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd
[edit file and save]
Traceback (most recent call last):
File "/usr/bin/sandbox", line 565, in <module>
rc = sandbox.main()
File "/usr/bin/sandbox", line 553, in main
return self.__execute()
~~~~~~~~~~~~~~^^
File "/usr/bin/sandbox", line 530, in __execute
savefile(dest, i, self.__options.X_ind)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/sandbox", line 133, in savefile
ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
^^^^^
UnboundLocalError: cannot access local variable 'input' where it is not associated with a valueSigned-off-by Robert Frohl <[email protected]>
--- sandbox/sandbox | 4 ---- 1 file changed, 4 deletions(-)
sandbox/sandbox +0 -4
@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind): if rc == Gtk.ResponseType.YES: copy = True else: - try: - input = raw_input - except NameError: - pass ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) if re.match(_("[yY]"), ans): copy = True
Signature · 1 line
2.53.0
Quoted 19 lines · Robert Frohl
Fixes the following backtrace on saving files:
$ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd [edit file and save] Traceback (most recent call last): File "/usr/bin/sandbox", line 565, in <module> rc = sandbox.main() File "/usr/bin/sandbox", line 553, in main return self.__execute() ~~~~~~~~~~~~~~^^ File "/usr/bin/sandbox", line 530, in __execute savefile(dest, i, self.__options.X_ind) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/sandbox", line 133, in savefile ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) ^^^^^ UnboundLocalError: cannot access local variable 'input' where it is not associated with a value
Quoted 1 line
Signed-off-by Robert Frohl <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 23 lines
--- sandbox/sandbox | 4 ---- 1 file changed, 4 deletions(-)sandbox/sandbox +0
-5@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind): if rc == Gtk.ResponseType.YES: copy = True else: - try: - input = raw_input - except NameError: - pass ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) if re.match(_("[yY]"), ans): copy = True --2.53.0
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Robert Frohl
Fixes the following backtrace on saving files:
$ sandbox -M -H sandbox_home/ -T sandbox_tmp/ /usr/bin/vim sandbox_home/cmd [edit file and save] Traceback (most recent call last): File "/usr/bin/sandbox", line 565, in <module> rc = sandbox.main() File "/usr/bin/sandbox", line 553, in main return self.__execute() ~~~~~~~~~~~~~~^^ File "/usr/bin/sandbox", line 530, in __execute savefile(dest, i, self.__options.X_ind) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/sandbox", line 133, in savefile ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) ^^^^^ UnboundLocalError: cannot access local variable 'input' where it is not associated with a value
Quoted 4 lines
Quoted 1 line
Signed-off-by Robert Frohl <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.
Thanks,
Jim
Quoted 24 lines
Quoted 23 lines
--- sandbox/sandbox | 4 ---- 1 file changed, 4 deletions(-)sandbox/sandbox +0
-5@@ -126,10 +126,6 @@ def savefile(new, orig, X_ind): if rc == Gtk.ResponseType.YES: copy = True else: - try: - input = raw_input - except NameError: - pass ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) if re.match(_("[yY]"), ans): copy = True --2.53.0