(attr_name, attr_value, evaluate_name, handle_return_values)
| 794 | |
| 795 | |
| 796 | def get_var_scope(attr_name, attr_value, evaluate_name, handle_return_values): |
| 797 | if attr_name.startswith("'"): |
| 798 | if attr_name.endswith("'"): |
| 799 | # i.e.: strings denote that it is a regular value in some container. |
| 800 | return "" |
| 801 | else: |
| 802 | i = attr_name.find("__' (") |
| 803 | if i >= 0: |
| 804 | # Handle attr_name such as: >>'__name__' (1732494379184)<< |
| 805 | attr_name = attr_name[1 : i + 2] |
| 806 | |
| 807 | if handle_return_values and attr_name == RETURN_VALUES_DICT: |
| 808 | return "" |
| 809 | |
| 810 | elif attr_name == GENERATED_LEN_ATTR_NAME: |
| 811 | return "" |
| 812 | |
| 813 | if attr_name.startswith("__") and attr_name.endswith("__"): |
| 814 | return DAPGrouper.SCOPE_SPECIAL_VARS |
| 815 | |
| 816 | if attr_name.startswith("_") or attr_name.endswith("__"): |
| 817 | return DAPGrouper.SCOPE_PROTECTED_VARS |
| 818 | |
| 819 | try: |
| 820 | if inspect.isroutine(attr_value) or isinstance(attr_value, MethodWrapperType): |
| 821 | return DAPGrouper.SCOPE_FUNCTION_VARS |
| 822 | |
| 823 | elif inspect.isclass(attr_value): |
| 824 | return DAPGrouper.SCOPE_CLASS_VARS |
| 825 | except: |
| 826 | # It's possible that isinstance throws an exception when dealing with user-code. |
| 827 | if DebugInfoHolder.DEBUG_TRACE_LEVEL > 0: |
| 828 | pydev_log.exception() |
| 829 | |
| 830 | return "" |
no test coverage detected