File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 110
110
group_create = Group .create
111
111
112
112
113
- # Create a proxy object to wrap libtiledb and provide a ` cc` alias
113
+ # Create a proxy class to handle the deprecation of `tiledb. cc`
114
114
class CCProxy :
115
115
def __init__ (self , module ):
116
116
self ._module = module
117
117
118
118
def __getattr__ (self , name ):
119
- warnings .warn (
120
- "`tiledb.cc` is deprecated. Please use `tiledb.libtiledb` instead." ,
121
- )
119
+ if not name .startswith ("__" ):
120
+ warnings .warn (
121
+ "`tiledb.cc` is deprecated. Please use `tiledb.libtiledb` instead." ,
122
+ )
122
123
return getattr (self ._module , name )
123
124
124
125
def __repr__ (self ):
@@ -128,9 +129,10 @@ def __repr__(self):
128
129
return self ._module .__repr__ ()
129
130
130
131
132
+ # Create a proxy object to wrap libtiledb and provide a `cc` alias
131
133
cc = CCProxy (libtiledb )
132
134
sys .modules ["tiledb.cc" ] = cc
133
- cc = cc
135
+ # Delete the class to avoid namespace pollution
134
136
del CCProxy
135
137
136
138
# Note: we use a modified namespace packaging to allow continuity of existing TileDB-Py imports.
You can’t perform that action at this time.
0 commit comments