~pyreadline/pyreadline/trunk

« back to all changes in this revision

Viewing changes to pyreadline/rlmain.py

  • Committer: Jorgen Stenarson
  • Date: 2011-10-06 19:02:52 UTC
  • mfrom: (100.1.19 python3)
  • Revision ID: jorgen.stenarson@bostream.nu-20111006190252-efh961vx5qbcohom
Merging python3 fixes from Shimizukawa

Show diffs side-by-side

added added

removed removed

Lines of Context:
282
282
            self.mode = modes[name]
283
283
 
284
284
        def bind_key(key, name):
285
 
            import new
 
285
            import types
286
286
            if callable(name):
287
 
                modes[mode]._bind_key(key, new.instancemethod(name, modes[mode], modes[mode].__class__))
 
287
                modes[mode]._bind_key(key, types.MethodType(name, modes[mode]))
288
288
            elif hasattr(modes[mode], name):
289
289
                modes[mode]._bind_key(key, getattr(modes[mode], name))
290
290
            else: