Skip to content

Commit a142f02

Browse files
committed
restore old fix for fixing cyclic dependency
1 parent 3b6946a commit a142f02

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

pygccxml/declarations/calldef.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from . import templates
2323
from . import declaration
2424
#from . import type_traits # moved below to fix a cyclic dependency problem
25-
type_traits = None
2625
from . import dependencies
2726
from . import call_invocation
2827

@@ -161,11 +160,6 @@ def _set_attributes( self, attributes ):
161160
class calldef_t( declaration.declaration_t ):
162161
"""base class for all "callable" declarations"""
163162
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-
169163
declaration.declaration_t.__init__( self, name )
170164
if not arguments:
171165
arguments = []
@@ -312,11 +306,7 @@ def __remove_parent_fname( self, demangled ):
312306
return demangled
313307

314308
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
320310

321311
if not self.demangled:
322312
self._demangled_name = ''
@@ -599,6 +589,7 @@ def __str__(self):
599589
@property
600590
def is_copy_constructor(self):
601591
"""returns True if described declaration is copy constructor, otherwise False"""
592+
from . import type_traits
602593
args = self.arguments
603594
if 1 != len( args ):
604595
return False
@@ -659,6 +650,7 @@ def __init__( self, *args, **keywords ):
659650
@property
660651
def class_types( self ):
661652
"""list of class/class declaration types, extracted from the operator arguments"""
653+
from . import type_traits
662654
if None is self.__class_types:
663655
self.__class_types = []
664656
for type_ in self.argument_types:

0 commit comments

Comments
 (0)