Ticket #12009: trac_12009.patch

File trac_12009.patch, 1.2 KB (added by Mike Hansen, 11 years ago)
  • sage/interfaces/gnuplot.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1338237279 25200
    # Node ID 0b9f4d9ebf2068732f2526d27f6d449cf8424b25
    # Parent  6a453352445704485c5ee59eb269dafc209035de
    #12009: optional package gnuplotpy-1.8.spkg causes test failure on sage-4.7.2
    
    diff --git a/sage/interfaces/gnuplot.py b/sage/interfaces/gnuplot.py
    a b  
    1818#*****************************************************************************
    1919
    2020import os, time
    21 
    22 try:
    23     import Gnuplot as GP
    24 except ImportError:
    25     # Functionality just won't be available
    26     pass
    27 
    2821from sage.structure.sage_object import SageObject
    2922
    3023class Gnuplot(SageObject):
     
    3629
    3730    def gnuplot(self):
    3831        try:
    39             return self.__gnuplot
     32            return self._gnuplot
    4033        except AttributeError:
    4134            try:
    42                 self.__gnuplot = GP.Gnuplot()
    43                 return self.__gnuplot
    44             except NameError:
     35                import Gnuplot as GP
     36                self._gnuplot = GP.Gnuplot()
     37                return self._gnuplot
     38            except ImportError:
    4539                raise RuntimeError, "Install the gnuplotpy Python module."
    4640
    4741    def __call__(self, line):