diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-01-13 17:50:30 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-01-13 17:50:30 +0100 |
| commit | 8b46b0c4bdfbaa07972311b1cf19616d5c5aff04 (patch) | |
| tree | 59167b2b8c1d331bfebf072d5ba84dd154f0b373 /tests/lock.py | |
| parent | 6c1711a80a8a7d011f4d5f49618ff396ad2f5722 (diff) | |
| parent | 85839f4f241c99f9e4ebb0a6a8847a2d433f1160 (diff) | |
| download | python-apt-8b46b0c4bdfbaa07972311b1cf19616d5c5aff04.tar.gz | |
merge from the debian experimental branch
Diffstat (limited to 'tests/lock.py')
| -rw-r--r-- | tests/lock.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lock.py b/tests/lock.py index 5d2697f1..d45b3964 100644 --- a/tests/lock.py +++ b/tests/lock.py @@ -1,15 +1,16 @@ #!/usr/bin/env python2.4 # # Test for the pkgCache code -# +# import apt_pkg -import sys, os +import sys +import os if __name__ == "__main__": lock = "/tmp/test.lck" - + apt_pkg.init() # system-lock @@ -21,27 +22,26 @@ if __name__ == "__main__": apt_pkg.PkgSystemLock() except SystemError, s: print "Can't get lock: (error text:\n%s)" % s - sys.exit(0) + sys.exit(0) apt_pkg.PkgSystemUnLock() # low-level lock - fd = apt_pkg.GetLock(lock,True) + fd = apt_pkg.GetLock(lock, True) print "Lockfile fd: %s" % fd # try to get lock without error flag pid = os.fork() if pid == 0: # child - fd = apt_pkg.GetLock(lock,False) + fd = apt_pkg.GetLock(lock, False) print "Lockfile fd (child): %s" % fd - sys.exit(0) + sys.exit(0) # try to get lock with error flag pid = os.fork() if pid == 0: # child - fd = apt_pkg.GetLock(lock,True) + fd = apt_pkg.GetLock(lock, True) print "Lockfile fd (child): %s" % fd - sys.exit(0) - + sys.exit(0) |
