|
| From: | Piotr Held |
| Subject: | [Octave-bug-tracker] [bug #52096] meta.class.fromName throws error when class name not found. |
| Date: | Fri, 22 Sep 2017 20:26:24 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?52096>
Summary: meta.class.fromName throws error when class name not
found.
Project: GNU Octave
Submitted by: jsoh425
Submitted on: Sat 23 Sep 2017 12:26:23 AM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Piotr Held
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The same happens for meta.package.fromName.
For Matlab these functions simply return an empty (0x0) class array or package
array. I wrote a simple patch that returns just an empty object ([](0x0))
instead. The functionality is already built-into Octave in the functions:
cdef_manager::find_class
<http://hg.savannah.gnu.org/hgweb/octave/file/1909078be6c7/libinterp/octave-value/ov-classdef.h#l1618>
cdef_manager::find_package
<http://hg.savannah.gnu.org/hgweb/octave/file/1909078be6c7/libinterp/octave-value/ov-classdef.h#l1624>.
The only change I made was to call them with the proper argument:
error_if_not_found == false.
I am attaching a patch in to this submission.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sat 23 Sep 2017 12:26:23 AM UTC Name: meta_no_error_patch.diff Size:
2KiB By: jsoh425
<http://savannah.gnu.org/bugs/download.php?file_id=41872>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52096>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |