Show More
@@ -84,6 +84,7 b" if os.environ.get('RTUNICODEPEDANTRY', F" | |||||
84 | except NameError: |
|
84 | except NameError: | |
85 | pass |
|
85 | pass | |
86 |
|
86 | |||
|
87 | origenviron = os.environ.copy() | |||
87 | osenvironb = getattr(os, 'environb', os.environ) |
|
88 | osenvironb = getattr(os, 'environb', os.environ) | |
88 | processlock = threading.Lock() |
|
89 | processlock = threading.Lock() | |
89 |
|
90 | |||
@@ -907,16 +908,21 b' class Test(unittest.TestCase):' | |||||
907 | # us to export. |
|
908 | # us to export. | |
908 | name_regex = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$') |
|
909 | name_regex = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$') | |
909 |
|
910 | |||
|
911 | # Do not restore these variables; otherwise tests would fail. | |||
|
912 | reqnames = {'PYTHON', 'TESTDIR', 'TESTTMP'} | |||
|
913 | ||||
910 | with open(scriptpath, 'w') as envf: |
|
914 | with open(scriptpath, 'w') as envf: | |
911 |
for name, value in o |
|
915 | for name, value in origenviron.items(): | |
912 | if not name_regex.match(name): |
|
916 | if not name_regex.match(name): | |
913 | # Skip environment variables with unusual names not |
|
917 | # Skip environment variables with unusual names not | |
914 | # allowed by most shells. |
|
918 | # allowed by most shells. | |
915 | continue |
|
919 | continue | |
|
920 | if name in reqnames: | |||
|
921 | continue | |||
916 | envf.write('%s=%s\n' % (name, shellquote(value))) |
|
922 | envf.write('%s=%s\n' % (name, shellquote(value))) | |
917 |
|
923 | |||
918 | for name in testenv: |
|
924 | for name in testenv: | |
919 |
if name in o |
|
925 | if name in origenviron or name in reqnames: | |
920 | continue |
|
926 | continue | |
921 | envf.write('unset %s\n' % (name,)) |
|
927 | envf.write('unset %s\n' % (name,)) | |
922 |
|
928 |
General Comments 0
You need to be logged in to leave comments.
Login now