All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix referenced before assignment error
@ 2013-05-01 20:25 Sven Vermeulen
  2013-10-16 19:26 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Vermeulen @ 2013-05-01 20:25 UTC (permalink / raw)
  To: selinux

Python warns with

  UnboundLocalError: local variable 'message' referenced before assignment

Assigning the first value to message, and append later.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
 policycoreutils/semanage/seobject.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
index 85bc37f..236a182 100644
--- a/policycoreutils/semanage/seobject.py
+++ b/policycoreutils/semanage/seobject.py
@@ -89,7 +89,7 @@ except:
 			self.log_list=[]
 
 		def log(self, msg, name = "", sename = "", serole = "", serange = "", oldsename = "", oldserole = "", oldserange = ""):
-			message += " %s name=%s" % (msg, name)
+			message = " %s name=%s" % (msg, name)
 			if sename != "":
 				message += " sename=" + sename
 			if oldsename != "":
-- 
1.8.1.5


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] Fix referenced before assignment error
  2013-05-01 20:25 [PATCH 1/1] Fix referenced before assignment error Sven Vermeulen
@ 2013-10-16 19:26 ` Stephen Smalley
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2013-10-16 19:26 UTC (permalink / raw)
  To: Sven Vermeulen; +Cc: selinux

On 05/01/2013 04:25 PM, Sven Vermeulen wrote:
> Python warns with
> 
>   UnboundLocalError: local variable 'message' referenced before assignment
> 
> Assigning the first value to message, and append later.
> 
> Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>

Thanks, applied.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-16 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 20:25 [PATCH 1/1] Fix referenced before assignment error Sven Vermeulen
2013-10-16 19:26 ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.