@@ -104,35 +104,8 @@ def dec(obj):
104
104
105
105
def anonymize_sid (sid , anon_sid_cmd ):
106
106
from subprocess import check_output
107
-
108
- import re , sys
109
- from doctest import OutputChecker , DocTestSuite
110
-
111
- class Py23DocChecker (OutputChecker ):
112
- def check_output (self , want , got , optionflags ):
113
- if sys .version_info [0 ] < 3 :
114
- # if running on py2, attempt to prefix all the strings
115
- # with "u" to signify that they're unicode literals
116
- want = re .sub ("'(.*?)'" , "u'\\ 1'" , want )
117
- return OutputChecker .check_output (self , want , got , optionflags )
118
-
119
- def load_tests (loader , tests , ignore ):
120
- tests .addTests (DocTestSuite (mymodule , checker = Py23DocChecker ()))
121
- return tests
122
-
123
- import os
124
- import os .path
125
107
cmd = [anon_sid_cmd , sid ]
126
- print ("CUSTOMDEBUG2" )
127
- print (os .getcwd ())
128
- shell_out = check_output (cmd )
129
- print (shell_out )
130
- if isinstance (shell_out , bytes ):
131
- anon_sid = shell_out .decode ()
132
- elif isinstance (shell_out , str ):
133
- anon_sid = shell_out
134
- else :
135
- raise TypeError ("subprocess did not return a valid string" )
108
+ anon_sid = check_output (cmd )
136
109
return anon_sid .strip ()
137
110
138
111
0 commit comments