# Error in creating block

**URL:** <https://www.ruby-forum.com/t/error-in-creating-block/241391>\
**Category:** GNU Radio\
**Created:** [April 2, 2015, 11:05am UTC](https://www.ruby-forum.com/t/error-in-creating-block/241391 "2015-04-02T11:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 2, 2015, 11:05am UTC](https://www.ruby-forum.com/t/error-in-creating-block/241391/1 "2015-04-02T11:05:07Z")

</div>

Hi…  
I crated a block named ‘costas\_loop\_cc’. but when I connect to test  
this  
block with NULL sink and NULL Source, shows the error like this:  
Error 1:  
Generating: “/home/lekha/top\_block.py”  
Executing: “/home/lekha/top\_block.py”

File “/home/lekha/top\_block.py”, line 31  
self.costas\_loop\_cc\_0 = --------\>  
^  
SyntaxError: invalid syntax

> > > Done

the part of the generated top\_block.py code related to error is:  
##################################################  
# Blocks  
##################################################  
self.costas\_loop\_cc\_0 = --------\>line 31  
cannot find ‘loop\_bw’: digital.costas\_loop\_cc($loop\_bw, $order)  
\<--------  
self.blocks\_null\_source\_0 =  
blocks.null\_source(gr.sizeof\_gr\_complex_1)  
self.blocks\_null\_sink\_0 =  
blocks.null\_sink(gr.sizeof\_gr\_complex_1)

```
    ##################################################
    # Connections
    ##################################################
    self.connect((self.blocks_null_source_0, 0),

```

(self.costas\_loop\_cc\_0, 0))  
self.connect((self.costas\_loop\_cc\_0, 0),  
(self.blocks\_null\_sink\_0,  
0))

I wish it is a small error but I couldn’t get. while creating a block  
when  
I execute gr\_modtool makexml command it shows the error :

AttributeError: ‘NoneType’ object has no attribute ‘group’.

what does it mean AttributeError? Is there any relation with this to  
above  
mentioned error. thanks for your advice

---

<div class="post-metadata">

**Author:** ![Vishwanatha\_H\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f19dbf/32.png) [@Vishwanatha\_H\_G](https://www.ruby-forum.com/u/Vishwanatha_H_G)\
**Post date:** [April 2, 2015, 12:22pm UTC](https://www.ruby-forum.com/t/error-in-creating-block/241391/2 "2015-04-02T12:22:52Z")

</div>

Hi Vishwanatha,

the generated python is bogus; the “------\>line31…\<------” should not  
be there. This indicates that there is something wrong with your GRC XML  
file, most probably the python command in the tag is  
failing. Reading the line “cannot find ‘loop\_bw’:  
digital.costas\_loop\_cc($loop\_bw, $order)”,  
I’d assume that you meant to use loop\_bw as a parameter to your block’s  
constructor/make function, but maybe forgot to define it somewhere else  
(or you’ve got a typo).

Greetings,  
Marcus
