~ubuntu-branches/debian/experimental/nuitka/experimental

« back to all changes in this revision

Viewing changes to nuitka/codegen/Contexts.py

  • Committer: Package Import Robot
  • Author(s): Kay Hayen
  • Date: 2014-10-05 19:28:20 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20141005192820-s06oca9rty517iy8
Tags: 0.5.5+ds-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        self.loop_break = None
48
48
        # Python3 frame exception stack
49
49
        self.frame_preservation_stack = []
 
50
 
50
51
        # For exception handlers visibility of caught exception
51
52
        self.exception_published = True
52
53
 
371
372
 
372
373
    if python_version >= 330:
373
374
        result += (
 
375
            # Modules have that attribute.
374
376
            "__loader__",
375
377
        )
376
378
 
 
379
    if python_version >= 340:
 
380
        result += (
 
381
            # YIELD_FROM uses this
 
382
            "send",
 
383
        )
 
384
 
 
385
 
377
386
    # For patching Python2 internal class type
378
387
    if python_version < 300:
379
388
        result += (
496
505
    # Plent of attributes, because it's storing so many different things.
497
506
    # pylint: disable=R0902
498
507
 
499
 
    def __init__(self, module_name, code_name, filename, is_empty,
 
508
    def __init__(self, module, module_name, code_name, filename, is_empty,
500
509
                global_context):
501
510
        PythonContextBase.__init__(self)
502
511
 
503
512
        TempMixin.__init__(self)
504
513
        CodeObjectsMixin.__init__(self)
505
514
 
 
515
        self.module = module
506
516
        self.name = module_name
507
517
        self.code_name = code_name
508
518
        self.filename = filename
520
530
    def __repr__(self):
521
531
        return "<PythonModuleContext instance for module %s>" % self.filename
522
532
 
 
533
    def getOwner(self):
 
534
        return self.module
 
535
 
523
536
    def isPythonModule(self):
524
537
        return True
525
538
 
631
644
    def getFunction(self):
632
645
        return self.function
633
646
 
 
647
    def getOwner(self):
 
648
        return self.function
 
649
 
634
650
    def hasLocalsDict(self):
635
651
        return self.function.hasLocalsDict()
636
652
 
697
713
        self.current_source_ref = None
698
714
        self.last_source_ref = None
699
715
 
 
716
    def getOwner(self):
 
717
        return self.parent.getOwner()
 
718
 
700
719
    def isPythonModule(self):
701
720
        return self.parent.isPythonModule()
702
721