mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	re.escape os.sep so that \ is interpreted properly in the regex.
This commit is contained in:
		
						commit
						53ec8ae6a5
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3,6 +3,7 @@ import codecs
 | 
			
		|||
import io
 | 
			
		||||
import logging
 | 
			
		||||
import os
 | 
			
		||||
import re
 | 
			
		||||
import shutil
 | 
			
		||||
import sys
 | 
			
		||||
import tempfile
 | 
			
		||||
| 
						 | 
				
			
			@ -94,10 +95,11 @@ class TestMain(unittest.TestCase):
 | 
			
		|||
            self.assertIn("Writing converted %s to %s" % (
 | 
			
		||||
                    os.path.join(self.py2_src_dir, name),
 | 
			
		||||
                    os.path.join(self.py3_dest_dir, name+suffix)), stderr)
 | 
			
		||||
        sep = re.escape(os.sep)
 | 
			
		||||
        self.assertRegex(
 | 
			
		||||
                stderr, r"No changes to .*/__init__\.py".replace("/", os.sep))
 | 
			
		||||
                stderr, r"No changes to .*/__init__\.py".replace("/", sep))
 | 
			
		||||
        self.assertNotRegex(
 | 
			
		||||
                stderr, r"No changes to .*/trivial\.py".replace("/", os.sep))
 | 
			
		||||
                stderr, r"No changes to .*/trivial\.py".replace("/", sep))
 | 
			
		||||
 | 
			
		||||
    def test_filename_changing_on_output_two_files(self):
 | 
			
		||||
        """2to3 two files in one directory with a new output dir."""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue