Skip to content

RuntimeError: attribute 'fullname' is only available when compiling C++ code #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
davidmalcolm opened this issue Feb 9, 2017 · 1 comment · May be fixed by #176
Open

RuntimeError: attribute 'fullname' is only available when compiling C++ code #72

davidmalcolm opened this issue Feb 9, 2017 · 1 comment · May be fixed by #176
Assignees

Comments

@davidmalcolm
Copy link
Owner

I got this error when trying to use gccutils.pformat when compiling C code:

{{{
File "/home/tromey/Space/Trunk/gcc-python-plugin/cvtlisp.py", line 204, in map_tree
print gccutils.pformat(tree)
File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 123, in pformat
return pp.pformat(obj)
File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 176, in pformat
return self._recursive_format_obj(obj, set(), 0)
File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 208, in _recursive_format_obj
visited, depth + 1)
File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 199, in _recursive_format_obj
for name, value in self.iter_tree_attrs(obj):
File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 143, in iter_tree_attrs
value = getattr(obj, name)
RuntimeError: attribute 'fullname' is only available when compiling C++ code
}}}

@davidmalcolm davidmalcolm self-assigned this Feb 9, 2017
@davidmalcolm
Copy link
Owner Author

Imported from trac issue 32. Created by tromey on 2012-01-25T16:52:42, last modified: 2012-01-25T16:52:42

jackrosenthal added a commit to jackrosenthal/gcc-python-plugin that referenced this issue May 29, 2019
* Add new function ``gcc.is_cplusplus`` to determine if we are
  compiling C++

* Use ``gcc.is_cplusplus`` in gccutils to not iterate over fullname
  when we are not using C++ (resolves davidmalcolm#72)

* Allow accessing ``gcc.Type.sizeof`` to raise a TypeError while
  pretty-printing to be silently ignored and not added to attributes

* Use ``pp_newline_and_flush`` instead of ``pp_newline`` in
  ``PyGccPrettyPrinter_as_string`` when we are using GCC 5.3 or
  later (as this provides the historic functionality relied upon)
jackrosenthal added a commit to jackrosenthal/gcc-python-plugin that referenced this issue May 29, 2019
* Add new function ``gcc.is_cplusplus`` to determine if we are
  compiling C++

* Use ``gcc.is_cplusplus`` in gccutils to not iterate over fullname
  when we are not using C++ (resolves davidmalcolm#72)

* Allow accessing ``gcc.Type.sizeof`` to raise a TypeError while
  pretty-printing to be silently ignored and not added to attributes

* Use ``pp_newline_and_flush`` instead of ``pp_newline`` in
  ``PyGccPrettyPrinter_as_string`` when we are using GCC 5.3 or
  later (as this provides the historic functionality relied upon)
@jackrosenthal jackrosenthal linked a pull request May 29, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant