Ticket #38: 0001-Don-t-copy-objects-wich-smells-like-GObject-ones.-Th.patch

File 0001-Don-t-copy-objects-wich-smells-like-GObject-ones.-Th.patch, 1.2 kB (added by inean, 3 years ago)

The patch :)

  • a/lib/reinteract/statement.py

    old new  
    77from custom_result import CustomResult 
    88from notebook import HelpResult 
    99from stdout_capture import StdoutCapture 
     10from gobject import GObject 
    1011 
    1112# A wrapper so we don't have to trap all exceptions when running statement.Execute 
    1213class ExecutionError(Exception): 
     
    9394            else: 
    9495                variable = mutation 
    9596 
     97            # don't make shallow copies of GObject derived instances 
     98            if (isinstance(scope[variable], GObject)): 
     99                break 
     100 
    96101            try: 
    97102                if type(scope[variable]) != type(sys): 
    98103                    scope[variable] = copy.copy(scope[variable])