~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Lib/test/test_os.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-07-06 16:52:42 UTC
  • mfrom: (1.2.1 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100706165242-2xv4i019r3et6c0j
Tags: 3.1.2+20100706-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.
  - Add debian/patches/overwrite-semaphore-check for Lucid buildds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import shutil
11
11
from test import support
12
12
 
 
13
# Detect whether we're on a Linux system that uses the (now outdated
 
14
# and unmaintained) linuxthreads threading library.  There's an issue
 
15
# when combining linuxthreads with a failed execv call: see
 
16
# http://bugs.python.org/issue4970.
 
17
if (hasattr(os, "confstr_names") and
 
18
    "CS_GNU_LIBPTHREAD_VERSION" in os.confstr_names):
 
19
    libpthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
 
20
    USING_LINUXTHREADS= libpthread.startswith("linuxthreads")
 
21
else:
 
22
    USING_LINUXTHREADS= False
 
23
 
13
24
# Tests creating TESTFN
14
25
class FileTests(unittest.TestCase):
15
26
    def setUp(self):
566
577
            pass
567
578
 
568
579
class ExecTests(unittest.TestCase):
 
580
    @unittest.skipIf(USING_LINUXTHREADS,
 
581
                     "avoid triggering a linuxthreads bug: see issue #4970")
569
582
    def test_execvpe_with_bad_program(self):
570
 
        self.assertRaises(OSError, os.execvpe, 'no such app-', ['no such app-'], None)
 
583
        self.assertRaises(OSError, os.execvpe, 'no such app-',
 
584
                          ['no such app-'], None)
571
585
 
572
586
    def test_execvpe_with_bad_arglist(self):
573
587
        self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)