|
22 | 22 | from . import templates |
23 | 23 | from . import declaration |
24 | 24 | #from . import type_traits # moved below to fix a cyclic dependency problem |
25 | | -type_traits = None |
26 | 25 | from . import dependencies |
27 | 26 | from . import call_invocation |
28 | 27 |
|
@@ -161,11 +160,6 @@ def _set_attributes( self, attributes ): |
161 | 160 | class calldef_t( declaration.declaration_t ): |
162 | 161 | """base class for all "callable" declarations""" |
163 | 162 | def __init__( self, name='', arguments=None, exceptions=None, return_type=None, has_extern=False, does_throw=True ): |
164 | | - # moved here to fix a cyclic dependency problem |
165 | | - from . import type_traits as tt |
166 | | - global type_traits |
167 | | - type_traits = tt |
168 | | - |
169 | 163 | declaration.declaration_t.__init__( self, name ) |
170 | 164 | if not arguments: |
171 | 165 | arguments = [] |
@@ -312,11 +306,7 @@ def __remove_parent_fname( self, demangled ): |
312 | 306 | return demangled |
313 | 307 |
|
314 | 308 | def _get_demangled_name( self ): |
315 | | - if type_traits==None: |
316 | | - # this shouldn't be necessary; the same code exists in the constructor |
317 | | - from . import type_traits as tt |
318 | | - global type_traits |
319 | | - type_traits = tt |
| 309 | + from . import type_traits |
320 | 310 |
|
321 | 311 | if not self.demangled: |
322 | 312 | self._demangled_name = '' |
@@ -599,6 +589,7 @@ def __str__(self): |
599 | 589 | @property |
600 | 590 | def is_copy_constructor(self): |
601 | 591 | """returns True if described declaration is copy constructor, otherwise False""" |
| 592 | + from . import type_traits |
602 | 593 | args = self.arguments |
603 | 594 | if 1 != len( args ): |
604 | 595 | return False |
@@ -659,6 +650,7 @@ def __init__( self, *args, **keywords ): |
659 | 650 | @property |
660 | 651 | def class_types( self ): |
661 | 652 | """list of class/class declaration types, extracted from the operator arguments""" |
| 653 | + from . import type_traits |
662 | 654 | if None is self.__class_types: |
663 | 655 | self.__class_types = [] |
664 | 656 | for type_ in self.argument_types: |
|
0 commit comments