Skip to content

Deprecation warning is incorrect #46

@nsheff

Description

@nsheff
In [17]: yam = yacman.YacAttMap(filepath="project_config.yaml")

In [18]: yam._file_path
/home/nsheff/.local/lib/python3.8/site-packages/yacman/yacman.py:365: UserWarning: The '_file_path' property is deprecated and will be removed in a future relase. Use YacAttMap.__internal._file_path instead.
  warn(
Out[18]: '/home/nsheff/project_config.yaml'

But:

In [19]: yam.__internal._file_path
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/attmap/_att_map_like.py in __getattr__(self, item, default)
     33         try:
---> 34             return super(AttMapLike, self).__getattribute__(item)
     35         except AttributeError:

AttributeError: 'AttMap' object has no attribute '_file_path'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/attmap/_att_map_like.py in __getattr__(self, item, default)
     36             try:
---> 37                 return self.__getitem__(item)
     38             except KeyError:

~/.local/lib/python3.8/site-packages/attmap/attmap.py in __getitem__(self, item)
     31     def __getitem__(self, item):
---> 32         return self.__dict__[item]
     33 

KeyError: '_file_path'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-19-b22463bccc3a> in <module>
----> 1 yam.__internal._file_path

~/.local/lib/python3.8/site-packages/attmap/_att_map_like.py in __getattr__(self, item, default)
     39                 # Requested item is unknown, but request was made via
     40                 # __getitem__ syntax, not attribute-access syntax.
---> 41                 raise AttributeError(item)
     42 
     43     @abc.abstractmethod

AttributeError: _file_path

And:

In [20]: yam.__internal.file_path
Out[20]: '/home/nsheff/project_config.yaml'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions