2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 22:05:27 +00:00

Initial port to python3 for utilities.

This commit is contained in:
Dmitrijs Ledkovs
2012-06-11 17:56:21 +01:00
parent 5b6b2bbc01
commit dac3c00862
6 changed files with 47 additions and 26 deletions

View File

@@ -101,6 +101,7 @@ TEMPLATES_DIR="%s/templates"
def tearDown(self):
'''Teardown for tests'''
if os.path.exists(self.tmpdir):
sys.stdout.write("%s\n" % self.tmpdir)
recursive_rm(self.tmpdir)
#
@@ -328,7 +329,7 @@ POLICYGROUPS_DIR="%s/templates"
def test_binary_symlink(self):
'''Test binary (symlink)'''
exe = os.path.join(self.tmpdir, 'exe')
open(exe, 'wa').close()
open(exe, 'a').close()
symlink = exe + ".lnk"
os.symlink(exe, symlink)
@@ -441,7 +442,7 @@ POLICYGROUPS_DIR="%s/templates"
self.assertFalse(inv_s in p, "Found '%s' in :\n%s" % (inv_s, p))
if debugging:
print p
sys.stdout.write("%s\n" % p)
return p
@@ -859,7 +860,7 @@ if __name__ == '__main__':
# Create the necessary files to import aa-easyprof
init = os.path.join(os.path.dirname(absfn), '__init__.py')
if not os.path.exists(init):
open(init, 'wa').close()
open(init, 'a').close()
created.append(init)
symlink = os.path.join(os.path.dirname(absfn), 'easyprof.py')