rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
def toggle_debugger(self, event=None): if self.executing: tkMessageBox.showerror("Don't debug now", "You can only toggle the debugger when idle", master=self.text) self.set_debugger_indicator() return "break" else: db = self.interp.getdebugger() if db: self.close_debugger() else: self.open_debugger() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
||
sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ sys.stdin = sys.__stdin__ | sys.stdout = self.save_stdout sys.stderr = self.save_stderr sys.stdin = self.save_stdin | def close(self): # Extend base class method if self.executing: # XXX Need to ask a question here if not tkMessageBox.askokcancel( "Kill?", "The program is still running; do you want to kill it?", default="ok", master=self.text): return "cancel" self.canceled = 1 if self.reading: self.top.quit() return "cancel" reply = PyShellEditorWindow.close(self) if reply != "cancel": self.flist.pyshell = None # Restore std streams sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ sys.stdin = sys.__stdin__ # Break cycles self.interp = None self.console = None return reply | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
return "Python Shell" | return self.shell_title | def short_title(self): return "Python Shell" | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
opts, args = getopt.getopt(sys.argv[1:], "d") | opts, args = getopt.getopt(sys.argv[1:], "c:deist:") | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
if o == "-d": | if o == '-c': cmd = a if o == '-d': | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
if args: for filename in sys.argv[1:]: | if edit: for filename in args: | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() | shell = PyShell(flist) interp = shell.interp flist.pyshell = shell if startup: filename = os.environ.get("IDLESTARTUP") or \ os.environ.get("PYTHONSTARTUP") if filename and os.path.isfile(filename): interp.execfile(filename) | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
t.open_debugger() | shell.open_debugger() if cmd: interp.execsource(cmd) elif not edit and args and args[0] != "-": interp.execfile(args[0]) shell.begin() | def main(): debug = 0 try: opts, args = getopt.getopt(sys.argv[1:], "d") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.exit(2) for o, a in opts: if o == "-d": debug = 1 global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) if args: for filename in sys.argv[1:]: flist.open(filename) aPath = os.path.abspath(os.path.dirname(filename)) if not aPath in sys.path: sys.path.insert(0, aPath) else: aPath = os.getcwd() if not aPath in sys.path: sys.path.insert(0, aPath) t = PyShell(flist) flist.pyshell = t t.begin() if debug: t.open_debugger() root.mainloop() | 9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py |
self.apply() self.cancel() | try: self.apply() finally: self.cancel() | def ok(self, event=None): | aa3bf1b430175396199b7f8f546ad31f71c5592d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa3bf1b430175396199b7f8f546ad31f71c5592d/tkSimpleDialog.py |
if debuginfo: self.move_file(debuginfo[0], self.dist_dir) | def run (self): | 4262a31ba47d577d67fbc10fb3ec0729a2d14bbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4262a31ba47d577d67fbc10fb3ec0729a2d14bbe/bdist_rpm.py |
|
if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) ) | exts.append( Extension('resource', ['resource.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 7eb7bd426bc260e6250d7b29a0a05fca725c0899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7eb7bd426bc260e6250d7b29a0a05fca725c0899/setup.py |
if short_first: self.format_option_strings = self.format_option_strings_short_first else: self.format_option_strings = self.format_option_strings_long_first | self.short_first = short_first | def __init__ (self, indent_increment, max_help_position, width, short_first): self.indent_increment = indent_increment self.help_position = self.max_help_position = max_help_position self.width = width self.current_indent = 0 self.level = 0 self.help_width = width - max_help_position if short_first: self.format_option_strings = self.format_option_strings_short_first else: self.format_option_strings = self.format_option_strings_long_first | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
raise NotImplementedError( "abstract method: use format_option_strings_short_first or " "format_option_strings_long_first instead.") def format_option_strings_short_first (self, option): opts = [] takes_value = option.takes_value() if takes_value: | if option.takes_value(): | def format_option_strings (self, option): """Return a comma-separated list of option strings & metavariables.""" raise NotImplementedError( "abstract method: use format_option_strings_short_first or " "format_option_strings_long_first instead.") | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) | short_opts = [sopt + metavar for sopt in option._short_opts] long_opts = [lopt + "=" + metavar for lopt in option._long_opts] else: short_opts = option._short_opts long_opts = option._long_opts if self.short_first: opts = short_opts + long_opts else: opts = long_opts + short_opts | def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) return ", ".join(opts) | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
def format_option_strings_long_first (self, option): opts = [] takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for lopt in option._long_opts: opts.append(lopt + "=" + metavar) for sopt in option._short_opts: opts.append(sopt + metavar) else: for opt in option._long_opts + option._short_opts: opts.append(opt) return ", ".join(opts) | def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) return ", ".join(opts) | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
|
self._short_opts = [] self._long_opts = [] | def __init__ (self, *opts, **attrs): # Set _short_opts, _long_opts attrs from 'opts' tuple opts = self._check_opt_strings(opts) self._set_opt_strings(opts) | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
|
raise OptionError("at least one option string must be supplied", self) | raise TypeError("at least one option string must be supplied") | def _check_opt_strings (self, opts): # Filter out None because early versions of Optik had exactly # one short option and one long option, either of which # could be None. opts = filter(None, opts) if not opts: raise OptionError("at least one option string must be supplied", self) return opts | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
self._short_opts = [] self._long_opts = [] | def _set_opt_strings (self, opts): self._short_opts = [] self._long_opts = [] for opt in opts: if len(opt) < 2: raise OptionError( "invalid option string %r: " "must be at least two characters long" % opt, self) elif len(opt) == 2: if not (opt[0] == "-" and opt[1] != "-"): raise OptionError( "invalid short option string %r: " "must be of the form -x, (x any non-dash char)" % opt, self) self._short_opts.append(opt) else: if not (opt[0:2] == "--" and opt[2] != "-"): raise OptionError( "invalid long option string %r: " "must start with --, followed by non-dash" % opt, self) self._long_opts.append(opt) | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
|
if self._short_opts or self._long_opts: return "/".join(self._short_opts + self._long_opts) else: raise RuntimeError, "short_opts and long_opts both empty!" | return "/".join(self._short_opts + self._long_opts) | def __str__ (self): if self._short_opts or self._long_opts: return "/".join(self._short_opts + self._long_opts) else: raise RuntimeError, "short_opts and long_opts both empty!" | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
setattr(values, dest, 1) | setattr(values, dest, True) | def take_action (self, action, dest, opt, value, values, parser): if action == "store": setattr(values, dest, value) elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true": setattr(values, dest, 1) elif action == "store_false": setattr(values, dest, 0) elif action == "append": values.ensure_value(dest, []).append(value) elif action == "count": setattr(values, dest, values.ensure_value(dest, 0) + 1) elif action == "callback": args = self.callback_args or () kwargs = self.callback_kwargs or {} self.callback(self, opt, value, parser, *args, **kwargs) elif action == "help": parser.print_help() sys.exit(0) elif action == "version": parser.print_version() sys.exit(0) else: raise RuntimeError, "unknown action %r" % self.action | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
setattr(values, dest, 0) | setattr(values, dest, False) | def take_action (self, action, dest, opt, value, values, parser): if action == "store": setattr(values, dest, value) elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true": setattr(values, dest, 1) elif action == "store_false": setattr(values, dest, 0) elif action == "append": values.ensure_value(dest, []).append(value) elif action == "count": setattr(values, dest, values.ensure_value(dest, 0) + 1) elif action == "callback": args = self.callback_args or () kwargs = self.callback_kwargs or {} self.callback(self, opt, value, parser, *args, **kwargs) elif action == "help": parser.print_help() sys.exit(0) elif action == "version": parser.print_version() sys.exit(0) else: raise RuntimeError, "unknown action %r" % self.action | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
your program (os.path.basename(sys.argv[0])). | your program (self.prog or os.path.basename(sys.argv[0])). prog : string the name of the current program (to override os.path.basename(sys.argv[0])). | def format_help (self, formatter): result = formatter.format_heading(self.title) formatter.indent() result += OptionContainer.format_help(self, formatter) formatter.dedent() return result | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
add_help_option=1): | add_help_option=1, prog=None): | def __init__ (self, usage=None, option_list=None, option_class=Option, version=None, conflict_handler="error", description=None, formatter=None, add_help_option=1): OptionContainer.__init__( self, option_class, conflict_handler, description) self.set_usage(usage) self.version = version self.allow_interspersed_args = 1 if formatter is None: formatter = IndentedHelpFormatter() self.formatter = formatter | 05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py |
spawn(("gpg", "--detach-sign", "-a", filename), | gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, | def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: spawn(("gpg", "--detach-sign", "-a", filename), dry_run=self.dry_run) | 49c6a9b35690fefdb1471c848c6c72cb076acd07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49c6a9b35690fefdb1471c848c6c72cb076acd07/upload.py |
g['BINLIBDEST']=os.path.join(sys.exec_prefix, "Lib") | g['BINLIBDEST']= os.path.join(sys.exec_prefix, "Lib") | def _init_nt(): """Initialize the module as appropriate for NT""" g=globals() # load config.h, though I don't know how useful this is parse_config_h(open( os.path.join(sys.exec_prefix, "include", "config.h")), g) # set basic install directories g['LIBDEST']=os.path.join(sys.exec_prefix, "Lib") g['BINLIBDEST']=os.path.join(sys.exec_prefix, "Lib") | 7b84dfff61ef4008680bd0426a4abacdbd2db041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7b84dfff61ef4008680bd0426a4abacdbd2db041/sysconfig.py |
... self.close = self.generator.close | ... def __init__(self, name): | 82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py |
|
>>> for s in sets: s.close() | ... def __str__(self): | 82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py |
|
... self.close = g.close | ... def __init__(self, g): | 82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py |
|
>>> m235.close() | >>> def m235(): | 82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py |
|
>>> fib.close() | ... def tail(g): | 82675db194a0b6021e6c2528f6442b5fafe69951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/82675db194a0b6021e6c2528f6442b5fafe69951/test_generators.py |
|
exclude=0, single=0, randomize=0, leakdebug=0, | exclude=0, single=0, randomize=0, findleaks=0, | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if o == '-l': leakdebug = 1 if o == '--have-resources': use_large_resources = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if leakdebug: try: import gc except ImportError: print 'cycle garbage collection not available' else: gc.set_debug(gc.DEBUG_LEAK) if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py |
single, randomize, and leakdebug) allow programmers calling main() | single, randomize, and findleaks) allow programmers calling main() | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if o == '-l': leakdebug = 1 if o == '--have-resources': use_large_resources = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if leakdebug: try: import gc except ImportError: print 'cycle garbage collection not available' else: gc.set_debug(gc.DEBUG_LEAK) if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py |
if o == '-l': leakdebug = 1 | if o == '-l': findleaks = 1 | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if o == '-l': leakdebug = 1 if o == '--have-resources': use_large_resources = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if leakdebug: try: import gc except ImportError: print 'cycle garbage collection not available' else: gc.set_debug(gc.DEBUG_LEAK) if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py |
if leakdebug: | if findleaks: | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if o == '-l': leakdebug = 1 if o == '--have-resources': use_large_resources = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if leakdebug: try: import gc except ImportError: print 'cycle garbage collection not available' else: gc.set_debug(gc.DEBUG_LEAK) if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py |
gc.set_debug(gc.DEBUG_LEAK) | gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl', ['have-resources']) except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if o == '-l': leakdebug = 1 if o == '--have-resources': use_large_resources = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if leakdebug: try: import gc except ImportError: print 'cycle garbage collection not available' else: gc.set_debug(gc.DEBUG_LEAK) if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_large_resources = use_large_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7a83ed02cacbb1387f4c8bd49f0a9ad98c6cc4/regrtest.py |
fullname = '.'.join(path)+'.'+name | fullname = string.join(path, '.')+'.'+name | def find_module(self, name, path): if path: fullname = '.'.join(path)+'.'+name else: fullname = name if fullname in self.excludes: self.msgout(3, "find_module -> Excluded", fullname) raise ImportError, name | 315b34e57013d60d33b0e132a4708a6b20278951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/315b34e57013d60d33b0e132a4708a6b20278951/modulefinder.py |
self.buf = self.buf + string.joinfields(self.buflist, '') | self.buf += EMPTYSTRING.join(self.buflist) | def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos) | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
pos = pos + self.pos | pos += self.pos | def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos) | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
pos = pos + self.len | pos += self.len | def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if mode == 1: pos = pos + self.pos elif mode == 2: pos = pos + self.len self.pos = max(0, pos) | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
self.buf = self.buf + string.joinfields(self.buflist, '') | self.buf += EMPTYSTRING.join(self.buflist) | def read(self, n = -1): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] if n < 0: newpos = self.len else: newpos = min(self.pos+n, self.len) r = self.buf[self.pos:newpos] self.pos = newpos return r | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
self.buf = self.buf + string.joinfields(self.buflist, '') | self.buf += EMPTYSTRING.join(self.buflist) | def readline(self, length=None): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] i = string.find(self.buf, '\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 if length is not None: if self.pos + length < newpos: newpos = self.pos + length r = self.buf[self.pos:newpos] self.pos = newpos return r | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
i = string.find(self.buf, '\n', self.pos) | i = self.buf.find('\n', self.pos) | def readline(self, length=None): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] i = string.find(self.buf, '\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 if length is not None: if self.pos + length < newpos: newpos = self.pos + length r = self.buf[self.pos:newpos] self.pos = newpos return r | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
raise IOError(errno.EINVAL, "Negative size not allowed") | raise IOError(EINVAL, "Negative size not allowed") | def truncate(self, size=None): if self.closed: raise ValueError, "I/O operation on closed file" if size is None: size = self.pos elif size < 0: raise IOError(errno.EINVAL, "Negative size not allowed") elif size < self.pos: self.pos = size self.buf = self.getvalue()[:size] | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
self.buf = self.buf + string.joinfields(self.buflist, '') | self.buf += EMPTYSTRING.join(self.buflist) | def write(self, s): if self.closed: raise ValueError, "I/O operation on closed file" if not s: return if self.pos > self.len: self.buflist.append('\0'*(self.pos - self.len)) self.len = self.pos newpos = self.pos + len(s) if self.pos < self.len: if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] self.buflist = [self.buf[:self.pos], s, self.buf[newpos:]] self.buf = '' if newpos > self.len: self.len = newpos else: self.buflist.append(s) self.len = newpos self.pos = newpos | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
self.write(string.joinfields(list, '')) | self.write(EMPTYSTRING.join(list)) | def writelines(self, list): self.write(string.joinfields(list, '')) | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
self.buf = self.buf + string.joinfields(self.buflist, '') | self.buf += EMPTYSTRING.join(self.buflist) | def getvalue(self): if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] return self.buf | 15b63f2f47a5f4876a820d2c1a39b891b5b7085b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15b63f2f47a5f4876a820d2c1a39b891b5b7085b/StringIO.py |
print 'Skip', path,'- Up-to-date' | print 'Skip', dstfile,'- Up-to-date' | def hexbincwprojects(creator): """Compact and hexbin all files remembered with a given creator""" print 'Please start project mgr with signature', creator,'-' sys.stdin.readline() try: mgr = MwShell(creator) except 'foo': print 'Not handled:', creator return for fss in project_files[creator]: srcfile = fss.as_pathname() dstfile = srcfile + '.hqx' if os.path.exists(dstfile) and \ os.stat(dstfile)[8] > os.stat(srcfile)[8]: print 'Skip', path,'- Up-to-date' continue print 'Compacting', dstfile mgr.open(fss) mgr.Reset_File_Paths() mgr.Remove_Binaries() mgr.Close_Project() print 'Binhexing', dstfile binhex.binhex(srcfile, dstfile) mgr.quit() | b5d44e9549704b0a87dded5104aec25d683258b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b5d44e9549704b0a87dded5104aec25d683258b0/binhextree.py |
self.botframe = frame | self.botframe = frame.f_back | def dispatch_call(self, frame, arg): # XXX 'arg' is no longer used if self.botframe is None: # First call of dispatch since reset() self.botframe = frame return self.trace_dispatch if not (self.stop_here(frame) or self.break_anywhere(frame)): # No need to trace this function return # None self.user_call(frame, arg) if self.quitting: raise BdbQuit return self.trace_dispatch | b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py |
if self.stopframe is None: return True | def stop_here(self, frame): if self.stopframe is None: return True if frame is self.stopframe: return True while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False | b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py |
|
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back | frame = sys._getframe().f_back | def set_trace(self): """Start debugging from here.""" try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back self.reset() while frame: frame.f_trace = self.trace_dispatch self.botframe = frame frame = frame.f_back self.set_step() sys.settrace(self.trace_dispatch) | b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py |
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back | frame = sys._getframe().f_back | def set_continue(self): # Don't stop except at breakpoints or when finished self.stopframe = self.botframe self.returnframe = None self.quitting = 0 if not self.breaks: # no breakpoints; run without debugger overhead sys.settrace(None) try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back while frame and frame is not self.botframe: del frame.f_trace frame = frame.f_back | b0c0eaa7ba47c8de99e78c653be75e08ad90a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0c0eaa7ba47c8de99e78c653be75e08ad90a31e/bdb.py |
(1, Complex(0,10), 'TypeError'), | (1, Complex(0,10), 1), | def test(): testsuite = { 'a+b': [ (1, 10, 11), (1, Complex(0,10), Complex(1,10)), (Complex(0,10), 1, Complex(1,10)), (Complex(0,10), Complex(1), Complex(1,10)), (Complex(1), Complex(0,10), Complex(1,10)), ], 'a-b': [ (1, 10, -9), (1, Complex(0,10), Complex(1,-10)), (Complex(0,10), 1, Complex(-1,10)), (Complex(0,10), Complex(1), Complex(-1,10)), (Complex(1), Complex(0,10), Complex(1,-10)), ], 'a*b': [ (1, 10, 10), (1, Complex(0,10), Complex(0, 10)), (Complex(0,10), 1, Complex(0,10)), (Complex(0,10), Complex(1), Complex(0,10)), (Complex(1), Complex(0,10), Complex(0,10)), ], 'a/b': [ (1., 10, 0.1), (1, Complex(0,10), Complex(0, -0.1)), (Complex(0, 10), 1, Complex(0, 10)), (Complex(0, 10), Complex(1), Complex(0, 10)), (Complex(1), Complex(0,10), Complex(0, -0.1)), ], 'pow(a,b)': [ (1, 10, 1), (1, Complex(0,10), 'TypeError'), (Complex(0,10), 1, Complex(0,10)), (Complex(0,10), Complex(1), Complex(0,10)), (Complex(1), Complex(0,10), 'TypeError'), (2, Complex(4,0), 16), ], 'cmp(a,b)': [ (1, 10, -1), (1, Complex(0,10), 1), (Complex(0,10), 1, -1), (Complex(0,10), Complex(1), -1), (Complex(1), Complex(0,10), 1), ], } exprs = testsuite.keys() exprs.sort() for expr in exprs: print expr + ':' t = (expr,) for item in testsuite[expr]: apply(checkop, t+item) | 5d63d562e8015e55591da523d87bba373733db00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d63d562e8015e55591da523d87bba373733db00/Complex.py |
(Complex(1), Complex(0,10), 'TypeError'), | (Complex(1), Complex(0,10), 1), | def test(): testsuite = { 'a+b': [ (1, 10, 11), (1, Complex(0,10), Complex(1,10)), (Complex(0,10), 1, Complex(1,10)), (Complex(0,10), Complex(1), Complex(1,10)), (Complex(1), Complex(0,10), Complex(1,10)), ], 'a-b': [ (1, 10, -9), (1, Complex(0,10), Complex(1,-10)), (Complex(0,10), 1, Complex(-1,10)), (Complex(0,10), Complex(1), Complex(-1,10)), (Complex(1), Complex(0,10), Complex(1,-10)), ], 'a*b': [ (1, 10, 10), (1, Complex(0,10), Complex(0, 10)), (Complex(0,10), 1, Complex(0,10)), (Complex(0,10), Complex(1), Complex(0,10)), (Complex(1), Complex(0,10), Complex(0,10)), ], 'a/b': [ (1., 10, 0.1), (1, Complex(0,10), Complex(0, -0.1)), (Complex(0, 10), 1, Complex(0, 10)), (Complex(0, 10), Complex(1), Complex(0, 10)), (Complex(1), Complex(0,10), Complex(0, -0.1)), ], 'pow(a,b)': [ (1, 10, 1), (1, Complex(0,10), 'TypeError'), (Complex(0,10), 1, Complex(0,10)), (Complex(0,10), Complex(1), Complex(0,10)), (Complex(1), Complex(0,10), 'TypeError'), (2, Complex(4,0), 16), ], 'cmp(a,b)': [ (1, 10, -1), (1, Complex(0,10), 1), (Complex(0,10), 1, -1), (Complex(0,10), Complex(1), -1), (Complex(1), Complex(0,10), 1), ], } exprs = testsuite.keys() exprs.sort() for expr in exprs: print expr + ':' t = (expr,) for item in testsuite[expr]: apply(checkop, t+item) | 5d63d562e8015e55591da523d87bba373733db00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d63d562e8015e55591da523d87bba373733db00/Complex.py |
self.file = self.sock.makefile('r') | self.file = self.sock.makefile('rb') | def open(self, host, port): """Setup connection to remote server on "host:port". This connection will be used by the routines: read, readline, send, shutdown. """ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((self.host, self.port)) self.file = self.sock.makefile('r') | 04103a153ea4758e2cbc44bdeb16aa3d06c59e57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04103a153ea4758e2cbc44bdeb16aa3d06c59e57/imaplib.py |
host = user + ':' + passwd + '@' + host | host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host | def retry_http_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = 'http://' + host + selector if data is None: return self.open(newurl) else: return self.open(newurl, data) | b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py |
host = user + ':' + passwd + '@' + host | host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host | def retry_https_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_https(newurl) | b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py |
return self.open_https(newurl) | return self.open_https(newurl, data) | def retry_https_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = host.find('@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_https(newurl) | b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b04c3ea26c2b7a16aa28a9a9ae2f16482c17396d/urllib.py |
sf = StringIO('Content-Length: %d\n' % retrlen) headers = mimetools.Message(sf) else: headers = noheaders() | headers += "Content-Length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) | def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') # XXX handle custom username & password try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) host, port = splitport(host) if port is None: port = ftplib.FTP_PORT path, attrs = splitattr(req.get_selector()) path = unquote(path) dirs = path.split('/') dirs, file = dirs[:-1], dirs[-1] if dirs and not dirs[0]: dirs = dirs[1:] user = passwd = '' # XXX try: fw = self.connect_ftp(user, passwd, host, port, dirs) type = file and 'I' or 'D' for attr in attrs: attr, value = splitattr(attr) if attr.lower() == 'type' and \ value in ('a', 'A', 'i', 'I', 'd', 'D'): type = value.upper() fp, retrlen = fw.retrfile(file, type) if retrlen is not None and retrlen >= 0: sf = StringIO('Content-Length: %d\n' % retrlen) headers = mimetools.Message(sf) else: headers = noheaders() return addinfourl(fp, headers, req.get_full_url()) except ftplib.all_errors, msg: raise IOError, ('ftp error', msg), sys.exc_info()[2] | c7175ef29367585cda7fe83ae56eec1a9bbb3095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7175ef29367585cda7fe83ae56eec1a9bbb3095/urllib2.py |
host = 'www.cwi.nl:80' selector = '/index.html' | host = 'www.python.org' selector = '/' | def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) errcode, errmsg, headers = h.getreply() print 'errcode =', errcode print 'headers =', headers print 'errmsg =', errmsg if headers: for header in headers.headers: print string.strip(header) print h.getfile().read() | 13f1e4ccda2702676721f1befbb119e8994986c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/13f1e4ccda2702676721f1befbb119e8994986c5/httplib.py |
print 'headers =', headers | def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) errcode, errmsg, headers = h.getreply() print 'errcode =', errcode print 'headers =', headers print 'errmsg =', errmsg if headers: for header in headers.headers: print string.strip(header) print h.getfile().read() | 13f1e4ccda2702676721f1befbb119e8994986c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/13f1e4ccda2702676721f1befbb119e8994986c5/httplib.py |
|
if not os.path.isfile(makefile): | if not os.path.isfile(makefile) or os.path.getsize(makefile)==0: | def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False configure = "VC-WIN64I" do_script = "ms\\do_win64i" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM" elif sys.argv[1] == "ReleaseAMD64": arch="amd64" debug=False configure = "VC-WIN64A" do_script = "ms\\do_win64a" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON" make_flags = "" if build_all: make_flags = "-a" # perl should be on the path, but we also look in "\perl" and "c:\\perl" # as "well known" locations perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perl = find_working_perl(perls) if perl is None: sys.exit(1) print "Found a working perl at '%s'" % (perl,) sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) old_cd = os.getcwd() try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(makefile): print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." sys.stdout.flush() rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) if rc: print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags print "Executing:", makeCommand sys.stdout.flush() rc = os.system(makeCommand) sys.exit(rc) | bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py |
run_configure(configure, do_script) | def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False configure = "VC-WIN64I" do_script = "ms\\do_win64i" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM" elif sys.argv[1] == "ReleaseAMD64": arch="amd64" debug=False configure = "VC-WIN64A" do_script = "ms\\do_win64a" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON" make_flags = "" if build_all: make_flags = "-a" # perl should be on the path, but we also look in "\perl" and "c:\\perl" # as "well known" locations perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perl = find_working_perl(perls) if perl is None: sys.exit(1) print "Found a working perl at '%s'" % (perl,) sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) old_cd = os.getcwd() try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(makefile): print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." sys.stdout.flush() rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) if rc: print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags print "Executing:", makeCommand sys.stdout.flush() rc = os.system(makeCommand) sys.exit(rc) | bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py |
|
print "Executing nmake over the ssl makefiles..." | makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) print "Executing ssl makefiles:", makeCommand | def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False configure = "VC-WIN64I" do_script = "ms\\do_win64i" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM" elif sys.argv[1] == "ReleaseAMD64": arch="amd64" debug=False configure = "VC-WIN64A" do_script = "ms\\do_win64a" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON" make_flags = "" if build_all: make_flags = "-a" # perl should be on the path, but we also look in "\perl" and "c:\\perl" # as "well known" locations perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perl = find_working_perl(perls) if perl is None: sys.exit(1) print "Found a working perl at '%s'" % (perl,) sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) old_cd = os.getcwd() try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(makefile): print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." sys.stdout.flush() rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) if rc: print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags print "Executing:", makeCommand sys.stdout.flush() rc = os.system(makeCommand) sys.exit(rc) | bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py |
rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) | rc = os.system(makeCommand) | def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False configure = "VC-WIN64I" do_script = "ms\\do_win64i" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM" elif sys.argv[1] == "ReleaseAMD64": arch="amd64" debug=False configure = "VC-WIN64A" do_script = "ms\\do_win64a" makefile = "ms\\nt.mak" os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON" make_flags = "" if build_all: make_flags = "-a" # perl should be on the path, but we also look in "\perl" and "c:\\perl" # as "well known" locations perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perl = find_working_perl(perls) if perl is None: sys.exit(1) print "Found a working perl at '%s'" % (perl,) sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) old_cd = os.getcwd() try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(makefile): print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." sys.stdout.flush() rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) if rc: print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags print "Executing:", makeCommand sys.stdout.flush() rc = os.system(makeCommand) sys.exit(rc) | bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc8a44e7dc764d268fbdc3c44a7e5f0602e956ea/build_ssl.py |
if not uthread2: | if uthread2: | def execstring(pytext, globals, locals, filename="<string>", debugging=0, modname="__main__", profiling=0): if debugging: import PyDebugger, bdb BdbQuit = bdb.BdbQuit else: BdbQuit = 'BdbQuitDummyException' pytext = string.split(pytext, '\r') pytext = string.join(pytext, '\n') + '\n' W.SetCursor("watch") globals['__name__'] = modname globals['__file__'] = filename sys.argv = [filename] try: code = compile(pytext, filename, "exec") except: # XXXX BAAAADDD.... We let tracebackwindow decide to treat SyntaxError # special. That's wrong because THIS case is special (could be literal # overflow!) and SyntaxError could mean we need a traceback (syntax error # in imported module!!! tracebackwindow.traceback(1, filename) return try: if debugging: if uthread2: uthread2.globalLock() PyDebugger.startfromhere() uthread2.globalUnlock() else: PyDebugger.startfromhere() elif not uthread2: MacOS.EnableAppswitch(0) try: if profiling: import profile, ProfileBrowser p = profile.Profile() p.set_cmd(filename) try: p.runctx(code, globals, locals) finally: import pstats stats = pstats.Stats(p) ProfileBrowser.ProfileBrowser(stats) else: exec code in globals, locals finally: if not uthread2: MacOS.EnableAppswitch(-1) except W.AlertError, detail: raise W.AlertError, detail except (KeyboardInterrupt, BdbQuit): pass except: if uthread2: uthread2.globalLock() if debugging: sys.settrace(None) PyDebugger.postmortem(sys.exc_type, sys.exc_value, sys.exc_traceback) return else: tracebackwindow.traceback(1, filename) if not uthread2: uthread2.globalUnlock() if debugging: sys.settrace(None) PyDebugger.stop() | 5e10bdfe10958c54bfb2d7ceace5480414f83b44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5e10bdfe10958c54bfb2d7ceace5480414f83b44/PyEdit.py |
scheme = urllib.splittype(url) | scheme, path = urllib.splittype(url) | def getpage(self, url_pair): # Incoming argument name is a (URL, fragment) pair. # The page may have been cached in the name_table variable. url, fragment = url_pair if self.name_table.has_key(url): return self.name_table[url] | ecf526e708be1036120a6c22e69316822aa8f96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecf526e708be1036120a6c22e69316822aa8f96a/webchecker.py |
self.draw['xscroll'] = self.draw.scrollX.set self.draw['yscroll'] = self.draw.scrollY.set | self.draw['xscrollcommand'] = self.draw.scrollX.set self.draw['yscrollcommand'] = self.draw.scrollY.set | def createWidgets(self): | 5ed621cc1b8f032243c17d561a7d07438eadf7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5ed621cc1b8f032243c17d561a7d07438eadf7e0/canvas-with-scrollbars.py |
def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument() | def __init__(self, host, port=None, key_file=None, cert_file=None): | def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument() HTTPConnection.__init__(self, host, port) self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') | f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py |
self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') | self.key_file = key_file self.cert_file = cert_file | def __init__(self, host, port=None, **x509): keys = x509.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass if keys: raise IllegalKeywordArgument() HTTPConnection.__init__(self, host, port) self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') | f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py |
pass class IllegalKeywordArgument(HTTPException): | def __init__(self, version): self.version = version | f71d815f6d0d1fff51094f6b246c622fb96c49ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f71d815f6d0d1fff51094f6b246c622fb96c49ee/httplib.py |
|
if line == '' or line == '\n' and self.skip_blanks: | if (line == '' or line == '\n') and self.skip_blanks: | def readline (self): """Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updates the current line number, so calling 'warn()' after 'readline()' emits a warning about the physical line(s) just read. Returns None on end-of-file, since the empty string can occur if 'rstrip_ws' is true but 'strip_blanks' is not.""" | 7389dad779f0ab697162fd05a2822896bed26a34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7389dad779f0ab697162fd05a2822896bed26a34/text_file.py |
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e | try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py |
except NameError: pass import pickle, random | except NameError: pass | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py |
if len(args) == 2: raise exc else: raise exc(*args[1]) | if len(args) == 2: raise exc else: raise exc(*args[1]) | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py |
type(e) is not exc): | type(e) is not exc): | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py |
new = pickle.loads(pickle.dumps(e, random.randint(0, 2))) for checkArgName in expected: self.assertEquals(repr(getattr(e, checkArgName)), repr(expected[checkArgName]), 'pickled exception "%s", attribute "%s' % (repr(e), checkArgName)) | for p in pickle, cPickle: for protocol in range(p.HIGHEST_PROTOCOL + 1): new = p.loads(p.dumps(e, protocol)) for checkArgName in expected: got = repr(getattr(new, checkArgName)) want = repr(expected[checkArgName]) self.assertEquals(got, want, 'pickled "%r", attribute "%s' % (e, checkArgName)) | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | a4f8143f339ee2036610c0d755b204bf7e2fc51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4f8143f339ee2036610c0d755b204bf7e2fc51f/test_exceptions.py |
"Compression requires the (missing) zlib module" | "Compression requires the (missing) zlib module" | def __init__(self, filename, mode="r", compression=ZIP_STORED): 'Open the ZIP file with mode read "r", write "w" or append "a".' if compression == ZIP_STORED: pass elif compression == ZIP_DEFLATED: if not zlib: raise RuntimeError,\ "Compression requires the (missing) zlib module" else: raise RuntimeError, "That compression method is not supported" self.debug = 0 # Level of printing: 0 through 3 self.NameToInfo = {} # Find file info given name self.filelist = [] # List of ZipInfo instances for archive self.compression = compression # Method of compression self.filename = filename self.mode = key = mode[0] if key == 'r': self.fp = open(filename, "rb") self._GetContents() elif key == 'w': self.fp = open(filename, "wb") elif key == 'a': fp = self.fp = open(filename, "r+b") fp.seek(-22, 2) # Seek to end-of-file record endrec = fp.read() if endrec[0:4] == stringEndArchive and \ endrec[-2:] == "\000\000": self._GetContents() # file is a zip file # seek to start of directory and overwrite fp.seek(self.start_dir, 0) else: # file is not a zip file, just append fp.seek(0, 2) else: raise RuntimeError, 'Mode must be "r", "w" or "a"' | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
'File name in Central Directory "%s" and File Header "%s" differ.' % ( data.filename, fname) | 'File name in directory "%s" and header "%s" differ.' % ( data.filename, fname) | def _GetContents(self): "Read in the table of contents for the zip file" fp = self.fp fp.seek(-22, 2) # Start of end-of-archive record filesize = fp.tell() + 22 # Get file size endrec = fp.read(22) # Archive must not end with a comment! if endrec[0:4] != stringEndArchive or endrec[-2:] != "\000\000": raise BadZipfile, "File is not a zip file, or ends with a comment" endrec = struct.unpack(structEndArchive, endrec) if self.debug > 1: print endrec size_cd = endrec[5] # bytes in central directory offset_cd = endrec[6] # offset of central directory x = filesize - 22 - size_cd # "concat" is zero, unless zip was concatenated to another file concat = x - offset_cd if self.debug > 2: print "given, inferred, offset", offset_cd, x, concat # self.start_dir: Position of start of central directory self.start_dir = offset_cd + concat fp.seek(self.start_dir, 0) total = 0 while total < size_cd: centdir = fp.read(46) total = total + 46 if centdir[0:4] != stringCentralDir: raise BadZipfile, "Bad magic number for central directory" centdir = struct.unpack(structCentralDir, centdir) if self.debug > 2: print centdir filename = fp.read(centdir[12]) # Create ZipInfo instance to store file information x = ZipInfo(filename) x.extra = fp.read(centdir[13]) x.comment = fp.read(centdir[14]) total = total + centdir[12] + centdir[13] + centdir[14] x.header_offset = centdir[18] + concat x.file_offset = x.header_offset + 30 + centdir[12] + centdir[13] (x.create_version, x.create_system, x.extract_version, x.reserved, x.flag_bits, x.compress_type, t, d, x.CRC, x.compress_size, x.file_size) = centdir[1:12] x.volume, x.internal_attr, x.external_attr = centdir[15:18] # Convert date/time code to (year, month, day, hour, min, sec) x.date_time = ( (d>>9)+1980, (d>>5)&0xF, d&0x1F, t>>11, (t>>5)&0x3F, (t&0x1F) * 2 ) self.filelist.append(x) self.NameToInfo[x.filename] = x if self.debug > 2: print "total", total for data in self.filelist: fp.seek(data.header_offset, 0) fheader = fp.read(30) if fheader[0:4] != stringFileHeader: raise BadZipfile, "Bad magic number for file header" fheader = struct.unpack(structFileHeader, fheader) fname = fp.read(fheader[10]) if fname != data.filename: raise RuntimeError, \ | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"Attempt to read ZIP archive that was already closed" | "Attempt to read ZIP archive that was already closed" | def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_offset, 0) bytes = self.fp.read(zinfo.compress_size) self.fp.seek(filepos, 0) if zinfo.compress_type == ZIP_STORED: pass elif zinfo.compress_type == ZIP_DEFLATED: if not zlib: raise RuntimeError, \ "De-compression requires the (missing) zlib module" # zlib compress/decompress code by Jeremy Hylton of CNRI dc = zlib.decompressobj(-15) bytes = dc.decompress(bytes) # need to feed in unused pad byte so that zlib won't choke ex = dc.decompress('Z') + dc.flush() if ex: bytes = bytes + ex else: raise BadZipfile, \ "Unsupported compression method %d for file %s" % \ (zinfo.compress_type, name) crc = binascii.crc32(bytes) if crc != zinfo.CRC: raise BadZipfile, "Bad CRC-32 for file %s" % name return bytes | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"De-compression requires the (missing) zlib module" | "De-compression requires the (missing) zlib module" | def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_offset, 0) bytes = self.fp.read(zinfo.compress_size) self.fp.seek(filepos, 0) if zinfo.compress_type == ZIP_STORED: pass elif zinfo.compress_type == ZIP_DEFLATED: if not zlib: raise RuntimeError, \ "De-compression requires the (missing) zlib module" # zlib compress/decompress code by Jeremy Hylton of CNRI dc = zlib.decompressobj(-15) bytes = dc.decompress(bytes) # need to feed in unused pad byte so that zlib won't choke ex = dc.decompress('Z') + dc.flush() if ex: bytes = bytes + ex else: raise BadZipfile, \ "Unsupported compression method %d for file %s" % \ (zinfo.compress_type, name) crc = binascii.crc32(bytes) if crc != zinfo.CRC: raise BadZipfile, "Bad CRC-32 for file %s" % name return bytes | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"Unsupported compression method %d for file %s" % \ | "Unsupported compression method %d for file %s" % \ | def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_offset, 0) bytes = self.fp.read(zinfo.compress_size) self.fp.seek(filepos, 0) if zinfo.compress_type == ZIP_STORED: pass elif zinfo.compress_type == ZIP_DEFLATED: if not zlib: raise RuntimeError, \ "De-compression requires the (missing) zlib module" # zlib compress/decompress code by Jeremy Hylton of CNRI dc = zlib.decompressobj(-15) bytes = dc.decompress(bytes) # need to feed in unused pad byte so that zlib won't choke ex = dc.decompress('Z') + dc.flush() if ex: bytes = bytes + ex else: raise BadZipfile, \ "Unsupported compression method %d for file %s" % \ (zinfo.compress_type, name) crc = binascii.crc32(bytes) if crc != zinfo.CRC: raise BadZipfile, "Bad CRC-32 for file %s" % name return bytes | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"Attempt to write ZIP archive that was already closed" | "Attempt to write ZIP archive that was already closed" | def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to write ZIP archive that was already closed" if zinfo.compress_type == ZIP_DEFLATED and not zlib: raise RuntimeError, \ "Compression requires the (missing) zlib module" if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED): raise RuntimeError, \ "That compression method is not supported" | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"Compression requires the (missing) zlib module" | "Compression requires the (missing) zlib module" | def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to write ZIP archive that was already closed" if zinfo.compress_type == ZIP_DEFLATED and not zlib: raise RuntimeError, \ "Compression requires the (missing) zlib module" if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED): raise RuntimeError, \ "That compression method is not supported" | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
"That compression method is not supported" | "That compression method is not supported" | def _writecheck(self, zinfo): 'Check for errors before writing a file to the archive' if self.NameToInfo.has_key(zinfo.filename): if self.debug: # Warning for duplicate names print "Duplicate name:", zinfo.filename if self.mode not in ("w", "a"): raise RuntimeError, 'write() requires mode "w" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to write ZIP archive that was already closed" if zinfo.compress_type == ZIP_DEFLATED and not zlib: raise RuntimeError, \ "Compression requires the (missing) zlib module" if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED): raise RuntimeError, \ "That compression method is not supported" | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
'Files added with writepy() must end with ".py"' | 'Files added with writepy() must end with ".py"' | def writepy(self, pathname, basename = ""): """Add all files from "pathname" to the ZIP archive. | d6c8480588120e48fba9de106754eef460bdf549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c8480588120e48fba9de106754eef460bdf549/zipfile.py |
raise xml.sax.SAXParseException(expat.ErrorString(error_code), None, self) | raise SAXParseException(expat.ErrorString(error_code), None, self) | def parse(self, stream_or_string): "Parse an XML document from a URL." if type(stream_or_string) is type(""): stream = open(stream_or_string) else: stream = stream_or_string | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
"Looks up and returns the state of a SAX2 feature." | if name == feature_namespaces: return self._namespaces | def getFeature(self, name): "Looks up and returns the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
"Sets the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name) | if self._parsing: raise SAXNotSupportedException("Cannot set features while parsing") if name == feature_namespaces: self._namespaces = state else: raise SAXNotRecognizedException("Feature '%s' not recognized" % name) | def setFeature(self, name, state): "Sets the state of a SAX2 feature." raise SAXNotRecognizedException("Feature '%s' not recognized" % name) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
"Looks up and returns the value of a SAX2 property." | def getProperty(self, name): "Looks up and returns the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
|
"Sets the value of a SAX2 property." | def setProperty(self, name, value): "Sets the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
|
self._parser.Parse(data, 0) | if not self._parser.Parse(data, 0): msg = pyexpat.ErrorString(self._parser.ErrorCode) raise SAXParseException(msg, None, self) | def feed(self, data): if not self._parsing: self._parsing = 1 self.reset() self._cont_handler.startDocument() # FIXME: error checking and endDocument() self._parser.Parse(data, 0) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
self._cont_handler.startElement(name, name, xmlreader.AttributesImpl(attrs, attrs)) | self._cont_handler.startElement(name, self._attrs) | def start_element(self, name, attrs): self._cont_handler.startElement(name, name, xmlreader.AttributesImpl(attrs, attrs)) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
self._cont_handler.endElement(name, name) | self._cont_handler.endElement(name) | def end_element(self, name): self._cont_handler.endElement(name, name) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
tup = (None, name) else: tup = pair | pair = (None, name) | def start_element_ns(self, name, attrs): pair = name.split() if len(pair) == 1: tup = (None, name) else: tup = pair | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
self._cont_handler.startElement(tup, None, xmlreader.AttributesImpl(attrs, None)) | self._cont_handler.startElementNS(pair, None, self._attrs) | def start_element_ns(self, name, attrs): pair = name.split() if len(pair) == 1: tup = (None, name) else: tup = pair | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
name = (None, name, None) else: name = pair + [None] | name = (None, name) | def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
self._cont_handler.endElement(name, None) | self._cont_handler.endElementNS(pair, None) | def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
def end_element_ns(self, name): pair = name.split() if len(pair) == 1: name = (None, name, None) else: name = pair + [None] # prefix is not implemented yet! self._cont_handler.endElement(name, None) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
||
def processing_instruction(self, target, data): self._cont_handler.processingInstruction(target, data) | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
||
assert 0 | raise NotImplementedError() | def external_entity_ref(self, context, base, sysid, pubid): assert 0 # not implemented source = self._ent_handler.resolveEntity(pubid, sysid) source = saxutils.prepare_input_source(source) # FIXME: create new parser, stack self._source and self._parser # FIXME: reuse code from self.parse(...) return 1 | c5252b9fd6d85186c0b2dd684b36bb5006dca568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5252b9fd6d85186c0b2dd684b36bb5006dca568/expatreader.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.