chflags: fixed empty opts argument v2.2.0_alpha127
authorZac Medico <zmedico@gentoo.org>
Wed, 12 Sep 2012 08:12:05 +0000 (01:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 12 Sep 2012 08:12:05 +0000 (01:12 -0700)
This broke in commit 09de8dc47ec48af2276dfa098dd5e1d3d09ddbdd.

pym/portage/__init__.py

index 8d5793c03af112c0663b44bf866edf3f58e8bcfa..ee51042116ddcb2668aa76849c3d95d2b380a3a0 100644 (file)
@@ -347,7 +347,11 @@ if platform.system() in ('FreeBSD',):
 
                @classmethod
                def chflags(cls, path, flags, opts=""):
-                       cmd = ['chflags', opts, '%o' % (flags,), path]
+                       cmd = ['chflags']
+                       if opts:
+                               cmd.append(opts)
+                       cmd.append('%o' % (flags,))
+                       cmd.append(path)
                        encoding = _encodings['fs']
                        if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
                                # Python 3.1 does not support bytes in Popen args.